gcc/gcc/config/mips/mips.c

13657 lines
422 KiB
C
Raw Normal View History

/* Subroutines used for MIPS code generation.
2000-02-26 22:35:46 +01:00
Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
1992-02-06 21:09:50 +01:00
Contributed by A. Lichnewsky, lich@inria.inria.fr.
Changes by Michael Meissner, meissner@osf.org.
64-bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
(dfhigh, dflow, sfhigh, sflow): New variables. (mips_sw_reg_names): Consistently use $ as name prefix. (large_int): Handle 64 bit constants. (reg_or_0_operand, mips_const_double_ok): Don't examine CONST_DOUBLE internals. (mips_const_double_ok): Use REAL_VALUE_* macros. (simple_memory_operand): Add 64 bit support. Only test TARGET_GP_OPT to determine if doing gp optimizations. Pass address not MEM to eliminate_constant_term. Use SMALL_INT. (mips_fill_delay_slot): Add 64 bit support. (mips_move_1word): Add 64 bit support. Don't examine CONST_DOUBLE internals. (mips_move_2words): Likewise. (mips_address_cost): Pass address not MEM to eliminate_constant_term. Use SMALL_INT. (gen_int_relational): New variable mode. Add 64 bit support. (gen_conditional_branch): Add 64 bit support. (block_move_load_store, block_move_loop, block_move_call, expand_block_move, output_block_move, function_arg_advance, function_arg, function_arg_partial_nregs): Likewise. (override_options): Clear MASK_GPOPT if threshold is zero or negative. Set MASK_GPOPT if optimizing. Set mips_isa from -misa= option, else from MIPS_ISA_DEFAULT if defined, else to 1. Make default cpu depend on isa. Add cpus r4400, r4600, orion. Rewrite TARGET_NAME_REGS support. Initialize dfhigh, dflow, sfhigh, sflow. Add 64 bit support. (print_operand): Use REAL_VALUE_* macros. (mips_output_external): Don't depend on mips_section_threshold. (make_temp_file): Define P_tmpdir when __MSDOS__. Malloc filename string. Don't unlink temp file when __MSDOS__. (mips_asm_file_start): Delete TARGET_NAME_REGS support. (mips_asm_file_end): Unlike temp file when __MSDOS__. (mips_declare_object): Don't test mips_sections_threshold. (compute_frame_size, save_restore_insns, function_prologue, mips_expand_prologue, function_epilogue, mips_expand_epilogue): Add 64 bit support. (function_epilogue): Correctly output `#' before .set volatile. From-SVN: r6391
1994-01-14 00:51:01 +01:00
Brendan Eich, brendan@microunity.com.
1992-02-06 21:09:50 +01:00
2003-09-27 06:48:30 +02:00
This file is part of GCC.
1992-02-06 21:09:50 +01:00
2003-09-27 06:48:30 +02:00
GCC is free software; you can redistribute it and/or modify
1992-02-06 21:09:50 +01:00
it under the terms of the GNU General Public License as published by
host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License... * config/host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * config/alpha/predicates.md, config/alpha/vms-ld.c, config/alpha/linux.h, config/alpha/alpha.opt, config/alpha/linux-elf.h, config/alpha/vms.h, config/alpha/elf.h, config/alpha/vms-unwind.h, config/alpha/ev4.md, config/alpha/ev6.md, config/alpha/alpha.c, config/alpha/vms-cc.c, config/alpha/alpha.h, config/alpha/sync.md, config/alpha/openbsd.h, config/alpha/alpha.md, config/alpha/alpha-modes.def, config/alpha/ev5.md, config/alpha/alpha-protos.h, config/alpha/freebsd.h, config/alpha/osf5.h, config/alpha/netbsd.h, config/alpha/vms64.h, config/alpha/constraints.md, config/alpha/osf.h, config/alpha/xm-vms.h, config/alpha/unicosmk.h, config/linux.h, config/frv/predicates.md, config/frv/frv.h, config/frv/linux.h, config/frv/frv.md, config/frv/frv.opt, config/frv/frv-modes.def, config/frv/frv-asm.h, config/frv/frv-protos.h, config/frv/frv-abi.h, config/frv/frv.c, config/s390/tpf.h, config/s390/s390.c, config/s390/predicates.md, config/s390/s390.h, config/s390/linux.h, config/s390/tpf.md, config/s390/tpf.opt, config/s390/2064.md, config/s390/2084.md, config/s390/s390.md, config/s390/s390.opt, config/s390/s390-modes.def, config/s390/fixdfdi.h, config/s390/constraints.md, config/s390/s390-protos.h, config/s390/s390x.h, config/elfos.h, config/dbxcoff.h, config/m32c/predicates.md, config/m32c/cond.md, config/m32c/m32c.c, config/m32c/minmax.md, config/m32c/blkmov.md, config/m32c/m32c-pragma.c, config/m32c/m32c.h, config/m32c/prologue.md, config/m32c/m32c.abi, config/m32c/muldiv.md, config/m32c/bitops.md, config/m32c/mov.md, config/m32c/addsub.md, config/m32c/m32c.md, config/m32c/m32c.opt, config/m32c/t-m32c, config/m32c/m32c-modes.def, config/m32c/jump.md, config/m32c/shift.md, config/m32c/m32c-protos.h, config/libgloss.h, config/spu/spu-protos.h, config/spu/predicates.md, config/spu/spu-builtins.h, config/spu/spu.c, config/spu/spu-builtins.def, config/spu/spu-builtins.md, config/spu/spu.h, config/spu/spu-elf.h, config/spu/constraints.md, config/spu/spu.md, config/spu/spu-c.c, config/spu/spu.opt, config/spu/spu-modes.def, config/spu/t-spu-elf, config/interix.h, config/sparc/hypersparc.md, config/sparc/predicates.md, config/sparc/linux.h, config/sparc/sp64-elf.h, config/sparc/supersparc.md, config/sparc/cypress.md, config/sparc/openbsd1-64.h, config/sparc/openbsd64.h, config/sparc/niagara.md, config/sparc/sparc.md, config/sparc/long-double-switch.opt, config/sparc/ultra3.md, config/sparc/sparc.opt, config/sparc/sync.md, config/sparc/sp-elf.h, config/sparc/sparc-protos.h, config/sparc/ultra1_2.md, config/sparc/biarch64.h, config/sparc/sparc.c, config/sparc/little-endian.opt, config/sparc/sysv4-only.h, config/sparc/sparc.h, config/sparc/linux64.h, config/sparc/freebsd.h, config/sparc/sol2.h, config/sparc/rtemself.h, config/sparc/netbsd-elf.h, config/sparc/vxworks.h, config/sparc/sparc-modes.def, config/sparc/sparclet.md, config/sparc/sysv4.h, config/vx-common.h, config/netbsd-aout.h, config/flat.h, config/m32r/m32r.md, config/m32r/predicates.md, config/m32r/little.h, config/m32r/m32r.c, config/m32r/m32r.opt, config/m32r/linux.h, config/m32r/constraints.md, config/m32r/m32r.h, config/m32r/m32r-protos.h, config/vxworks.opt, config/darwin-c.c, config/darwin.opt, config/i386/i386.h, config/i386/cygming.h, config/i386/linux.h, config/i386/cygwin.h, config/i386/i386.md, config/i386/netware-crt0.c, config/i386/sco5.h, config/i386/mmx.md, config/i386/vx-common.h, config/i386/kaos-i386.h, config/i386/winnt-stubs.c, config/i386/netbsd64.h, config/i386/djgpp.h, config/i386/gas.h, config/i386/sol2.h, config/i386/constraints.md, config/i386/netware-libgcc.c, config/i386/sysv5.h, config/i386/predicates.md, config/i386/geode.md, config/i386/x86-64.h, config/i386/kfreebsd-gnu.h, config/i386/freebsd64.h, config/i386/vxworksae.h, config/i386/pentium.md, config/i386/lynx.h, config/i386/i386elf.h, config/i386/rtemself.h, config/i386/netbsd-elf.h, config/i386/ppro.md, config/i386/k6.md, config/i386/netware.c, config/i386/netware.h, config/i386/i386-modes.def, config/i386/sysv4-cpp.h, config/i386/i386-interix.h, config/i386/cygwin1.c, config/i386/djgpp.opt, config/i386/uwin.h, config/i386/unix.h, config/i386/ptx4-i.h, config/i386/xm-djgpp.h, config/i386/att.h, config/i386/winnt.c, config/i386/beos-elf.h, config/i386/sol2-10.h, config/i386/darwin64.h, config/i386/sse.md, config/i386/i386.opt, config/i386/bsd.h, config/i386/cygming.opt, config/i386/xm-mingw32.h, config/i386/linux64.h, config/i386/openbsdelf.h, config/i386/xm-cygwin.h, config/i386/sco5.opt, config/i386/darwin.h, config/i386/mingw32.h, config/i386/winnt-cxx.c, config/i386/i386-interix3.h, config/i386/nwld.c, config/i386/nwld.h, config/i386/host-cygwin.c, config/i386/cygwin2.c, config/i386/i386-protos.h, config/i386/sync.md, config/i386/openbsd.h, config/i386/host-mingw32.c, config/i386/i386-aout.h, config/i386/nto.h, config/i386/biarch64.h, config/i386/i386-coff.h, config/i386/freebsd.h, config/i386/driver-i386.c, config/i386/knetbsd-gnu.h, config/i386/host-i386-darwin.c, config/i386/vxworks.h, config/i386/crtdll.h, config/i386/i386.c, config/i386/sysv4.h, config/darwin-protos.h, config/linux.opt, config/sol2.c, config/sol2.h, config/sh/symbian.c, config/sh/sh-protos.h, config/sh/linux.h, config/sh/elf.h, config/sh/superh.h, config/sh/sh4.md, config/sh/coff.h, config/sh/newlib.h, config/sh/embed-elf.h, config/sh/symbian-pre.h, config/sh/rtems.h, config/sh/kaos-sh.h, config/sh/sh4a.md, config/sh/constraints.md, config/sh/sh64.h, config/sh/sh.opt, config/sh/symbian-post.h, config/sh/sh-c.c, config/sh/predicates.md, config/sh/sh.c, config/sh/sh.h, config/sh/shmedia.md, config/sh/sh-modes.def, config/sh/little.h, config/sh/sh1.md, config/sh/sh4-300.md, config/sh/superh64.h, config/sh/rtemself.h, config/sh/netbsd-elf.h, config/sh/sh.md, config/sh/vxworks.h, config/usegas.h, config/svr3.h, config/pdp11/pdp11-protos.h, config/pdp11/2bsd.h, config/pdp11/pdp11.md, config/pdp11/pdp11.c, config/pdp11/pdp11.opt, config/pdp11/pdp11-modes.def, config/pdp11/pdp11.h, config/avr/rtems.h, config/avr/avr-protos.h, config/avr/predicates.md, config/avr/constraints.md, config/avr/avr.md, config/avr/avr.c, config/avr/avr.opt, config/avr/avr.h, config/sol2-protos.h, config/dbxelf.h, config/lynx.opt, config/crx/crx.h, config/crx/crx-protos.h, config/crx/crx.md, config/crx/crx.c, config/crx/crx.opt, config/c4x/c4x-c.c, config/c4x/c4x.c, config/c4x/c4x.opt, config/c4x/c4x-modes.def, config/c4x/rtems.h, config/c4x/predicates.md, config/c4x/c4x.h, config/c4x/c4x-protos.h, config/c4x/c4x.md, config/kfreebsd-gnu.h, config/xtensa/predicates.md, config/xtensa/xtensa.c, config/xtensa/linux.h, config/xtensa/xtensa.h, config/xtensa/elf.h, config/xtensa/xtensa.md, config/xtensa/xtensa.opt, config/xtensa/constraints.md, config/xtensa/xtensa-protos.h, config/dbx.h, config/stormy16/predicates.md, config/stormy16/stormy16.md, config/stormy16/stormy16.c, config/stormy16/stormy16.opt, config/stormy16/stormy16.h, config/stormy16/stormy16-protos.h, config/host-solaris.c, config/fr30/fr30.h, config/fr30/predicates.md, config/fr30/fr30-protos.h, config/fr30/fr30.md, config/fr30/fr30.c, config/fr30/fr30.opt, config/vxworksae.h, config/sol2-c.c, config/lynx.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/predicates.md, config/m68hc11/m68hc11.md, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.opt, config/m68hc11/m68hc11.h, config/m68hc11/m68hc12.h, config/openbsd-oldgas.h, config/host-linux.c, config/interix3.h, config/cris/cris.c, config/cris/predicates.md, config/cris/linux.h, config/cris/cris.h, config/cris/aout.h, config/cris/cris.md, config/cris/linux.opt, config/cris/cris.opt, config/cris/elf.opt, config/cris/aout.opt, config/cris/cris-protos.h, config/vxworks-dummy.h, config/netbsd.h, config/netbsd-elf.h, config/iq2000/iq2000.h, config/iq2000/predicates.md, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.md, config/iq2000/iq2000.c, config/iq2000/iq2000.opt, config/host-darwin.c, config/mt/mt.md, config/mt/mt.c, config/mt/mt.opt, config/mt/t-mt, config/mt/mt.h, config/mt/mt-protos.h, config/svr4.h, config/host-darwin.h, config/chorus.h, config/mn10300/mn10300.c, config/mn10300/mn10300.opt, config/mn10300/predicates.md, config/mn10300/mn10300.h, config/mn10300/linux.h, config/mn10300/constraints.md, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.md, config/ia64/predicates.md, config/ia64/itanium1.md, config/ia64/unwind-ia64.h, config/ia64/ia64-c.c, config/ia64/sync.md, config/ia64/ia64.c, config/ia64/itanium2.md, config/ia64/ia64.h, config/ia64/vect.md, config/ia64/freebsd.h, config/ia64/ia64.md, config/ia64/ia64-modes.def, config/ia64/constraints.md, config/ia64/hpux.h, config/ia64/ia64-protos.h, config/windiss.h, config/gofast.h, config/rtems.h, config/sol2-10.h, config/m68k/predicates.md, config/m68k/m68k.md, config/m68k/linux.h, config/m68k/m68k-modes.def, config/m68k/print-sysroot-suffix.sh, config/m68k/m68k-protos.h, config/m68k/coff.h, config/m68k/m68k-none.h, config/m68k/ieee.opt, config/m68k/openbsd.h, config/m68k/m68k-aout.h, config/m68k/m68k.opt, config/m68k/m68020-elf.h, config/m68k/m68kelf.h, config/m68k/m68k-devices.def, config/m68k/uclinux-oldabi.h, config/m68k/m68k.c, config/m68k/constraints.md, config/m68k/rtemself.h, config/m68k/netbsd-elf.h, config/m68k/m68k.h, config/m68k/uclinux.h, config/rs6000/power4.md, config/rs6000/host-darwin.c, config/rs6000/6xx.md, config/rs6000/linux.h, config/rs6000/eabi.h, config/rs6000/aix41.opt, config/rs6000/xcoff.h, config/rs6000/secureplt.h, config/rs6000/linuxspe.h, config/rs6000/eabialtivec.h, config/rs6000/8540.md, config/rs6000/darwin8.h, config/rs6000/kaos-ppc.h, config/rs6000/windiss.h, config/rs6000/603.md, config/rs6000/aix41.h, config/rs6000/cell.md, config/rs6000/mpc.md, config/rs6000/aix43.h, config/rs6000/beos.h, config/rs6000/gnu.h, config/rs6000/rtems.h, config/rs6000/aix.opt, config/rs6000/darwin.md, config/rs6000/darwin64.h, config/rs6000/default64.h, config/rs6000/7xx.md, config/rs6000/darwin.opt, config/rs6000/spe.md, config/rs6000/rs6000.opt, config/rs6000/rs6000-c.c, config/rs6000/rios2.md, config/rs6000/linuxaltivec.h, config/rs6000/7450.md, config/rs6000/linux64.h, config/rs6000/constraints.md, config/rs6000/440.md, config/rs6000/darwin.h, config/rs6000/host-ppc64-darwin.c, config/rs6000/rs6000.c, config/rs6000/aix52.h, config/rs6000/rs6000.h, config/rs6000/power6.md, config/rs6000/predicates.md, config/rs6000/altivec.md, config/rs6000/aix64.opt, config/rs6000/rios1.md, config/rs6000/rs6000-modes.def, config/rs6000/rs64.md, config/rs6000/eabisim.h, config/rs6000/sysv4le.h, config/rs6000/darwin7.h, config/rs6000/dfp.md, config/rs6000/linux64.opt, config/rs6000/sync.md, config/rs6000/vxworksae.h, config/rs6000/power5.md, config/rs6000/lynx.h, config/rs6000/biarch64.h, config/rs6000/rs6000.md, config/rs6000/sysv4.opt, config/rs6000/eabispe.h, config/rs6000/e500.h, config/rs6000/freebsd.h, config/rs6000/rs6000-protos.h, config/rs6000/netbsd.h, config/rs6000/e500-double.h, config/rs6000/aix.h, config/rs6000/vxworks.h, config/rs6000/40x.md, config/rs6000/aix51.h, config/rs6000/sysv4.h, config/arc/arc-protos.h, config/arc/arc.md, config/arc/arc.c, config/arc/arc.opt, config/arc/arc-modes.def, config/arc/arc.h, config/mcore/mcore-elf.h, config/mcore/mcore-protos.h, config/mcore/predicates.md, config/mcore/mcore.md, config/mcore/mcore.c, config/mcore/mcore.opt, config/mcore/mcore.h, config/mcore/mcore-pe.h, config/darwin.c, config/freebsd-nthr.h, config/score/predicates.md, config/score/score-version.h, config/score/score-protos.h, config/score/misc.md, config/score/elf.h, config/score/score.c, config/score/mac.md, config/score/score7.md, config/score/score.h, config/score/score-conv.h, config/score/score-mdaux.c, config/score/score.md, config/score/score.opt, config/score/score-modes.def, config/score/score-mdaux.h, config/score/mul-div.S, config/arm/uclinux-elf.h, config/arm/semi.h, config/arm/ecos-elf.h, config/arm/arm1020e.md, config/arm/symbian.h, config/arm/linux-elf.h, config/arm/arm1026ejs.md, config/arm/arm1136jfs.md, config/arm/elf.h, config/arm/aout.h, config/arm/arm.c, config/arm/thumb2.md, config/arm/vec-common.md, config/arm/coff.h, config/arm/strongarm-pe.h, config/arm/arm.h, config/arm/cortex-a8-neon.md, config/arm/semiaof.h, config/arm/cortex-a8.md, config/arm/uclinux-eabi.h, config/arm/arm-modes.def, config/arm/linux-eabi.h, config/arm/rtems-elf.h, config/arm/neon-schedgen.ml, config/arm/arm-cores.def, config/arm/arm-protos.h, config/arm/vfp.md, config/arm/aof.h, config/arm/linux-gas.h, config/arm/wince-pe.h, config/arm/neon.md, config/arm/constraints.md, config/arm/neon.ml, config/arm/xscale-elf.h, config/arm/strongarm-coff.h, config/arm/arm.opt, config/arm/arm926ejs.md, config/arm/predicates.md, config/arm/iwmmxt.md, config/arm/arm_neon.h, config/arm/unknown-elf.h, config/arm/kaos-arm.h, config/arm/bpabi.h, config/arm/pe.opt, config/arm/neon-testgen.ml, config/arm/arm.md, config/arm/xscale-coff.h, config/arm/pe.c, config/arm/arm-generic.md, config/arm/pe.h, config/arm/kaos-strongarm.h, config/arm/freebsd.h, config/arm/neon-docgen.ml, config/arm/netbsd.h, config/arm/fpa.md, config/arm/strongarm-elf.h, config/arm/cirrus.md, config/arm/netbsd-elf.h, config/arm/vxworks.h, config/arm/neon-gen.ml, config/kaos.h, config/darwin-driver.c, config/pa/predicates.md, config/pa/pa64-hpux.h, config/pa/pa-hpux.opt, config/pa/som.h, config/pa/pa-hpux1010.opt, config/pa/pa-hpux1111.opt, config/pa/pa-pro-end.h, config/pa/elf.h, config/pa/fptr.c, config/pa/pa64-linux.h, config/pa/pa.md, config/pa/pa.opt, config/pa/pa-hpux.h, config/pa/pa-hpux10.h, config/pa/pa-hpux11.h, config/pa/pa-hpux1010.h, config/pa/pa-protos.h, config/pa/pa-osf.h, config/pa/pa-hpux1111.h, config/pa/pa-64.h, config/pa/milli64.S, config/pa/pa.c, config/pa/pa-linux.h, config/pa/pa.h, config/pa/pa32-linux.h, config/pa/pa64-hpux.opt, config/pa/pa64-regs.h, config/pa/pa-modes.def, config/pa/constraints.md, config/darwin9.h, config/mips/4100.md, config/mips/linux.h, config/mips/elfoabi.h, config/mips/elf.h, config/mips/sdb.h, config/mips/windiss.h, config/mips/rtems.h, config/mips/3000.md, config/mips/iris5.h, config/mips/5000.md, config/mips/7000.md, config/mips/9000.md, config/mips/4600.md, config/mips/linux64.h, config/mips/elforion.h, config/mips/constraints.md, config/mips/generic.md, config/mips/predicates.md, config/mips/4300.md, config/mips/mips-ps-3d.md, config/mips/iris.h, config/mips/24k.md, config/mips/mips.md, config/mips/mips.opt, config/mips/4k.md, config/mips/5k.md, config/mips/vr4120-div.S, config/mips/openbsd.h, config/mips/iris6.h, config/mips/4000.md, config/mips/mips-protos.h, config/mips/6000.md, config/mips/mips.c, config/mips/mips.h, config/mips/r3900.h, config/mips/74k.md, config/mips/netbsd.h, config/mips/vxworks.h, config/mips/mips-modes.def, config/mips/vr.h, config/soft-fp/t-softfp, config/openbsd.h, config/ptx4.h, config/freebsd-spec.h, config/vax/vax.c, config/vax/openbsd.h, config/vax/vax.h, config/vax/elf.h, config/vax/vax.md, config/vax/bsd.h, config/vax/vax.opt, config/vax/vax-modes.def, config/vax/openbsd1.h, config/vax/netbsd.h, config/vax/vax-protos.h, config/vax/netbsd-elf.h, config/vax/vaxv.h, config/vax/ultrix.h, config/freebsd.h, config/h8300/rtems.h, config/h8300/predicates.md, config/h8300/h8300.c, config/h8300/h8300.h, config/h8300/elf.h, config/h8300/h8300.md, config/h8300/h8300.opt, config/h8300/coff.h, config/h8300/h8300-protos.h, config/v850/v850.md, config/v850/predicates.md, config/v850/v850-c.c, config/v850/v850.c, config/v850/v850.opt, config/v850/v850.h, config/v850/v850-protos.h, config/vxworks.c, config/knetbsd-gnu.h, config/sol2-6.h, config/vxworks.h, config/mmix/mmix.h, config/mmix/predicates.md, config/mmix/mmix-protos.h, config/mmix/mmix.md, config/mmix/mmix.c, config/mmix/mmix.opt, config/mmix/mmix-modes.def, config/bfin/bfin.opt, config/bfin/rtems.h, config/bfin/bfin-modes.def, config/bfin/predicates.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/bfin/bfin.h, config/bfin/bfin.md: Likewise. From-SVN: r127157
2007-08-02 12:49:31 +02:00
the Free Software Foundation; either version 3, or (at your option)
1992-02-06 21:09:50 +01:00
any later version.
2003-09-27 06:48:30 +02:00
GCC is distributed in the hope that it will be useful,
1992-02-06 21:09:50 +01:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License... * config/host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * config/alpha/predicates.md, config/alpha/vms-ld.c, config/alpha/linux.h, config/alpha/alpha.opt, config/alpha/linux-elf.h, config/alpha/vms.h, config/alpha/elf.h, config/alpha/vms-unwind.h, config/alpha/ev4.md, config/alpha/ev6.md, config/alpha/alpha.c, config/alpha/vms-cc.c, config/alpha/alpha.h, config/alpha/sync.md, config/alpha/openbsd.h, config/alpha/alpha.md, config/alpha/alpha-modes.def, config/alpha/ev5.md, config/alpha/alpha-protos.h, config/alpha/freebsd.h, config/alpha/osf5.h, config/alpha/netbsd.h, config/alpha/vms64.h, config/alpha/constraints.md, config/alpha/osf.h, config/alpha/xm-vms.h, config/alpha/unicosmk.h, config/linux.h, config/frv/predicates.md, config/frv/frv.h, config/frv/linux.h, config/frv/frv.md, config/frv/frv.opt, config/frv/frv-modes.def, config/frv/frv-asm.h, config/frv/frv-protos.h, config/frv/frv-abi.h, config/frv/frv.c, config/s390/tpf.h, config/s390/s390.c, config/s390/predicates.md, config/s390/s390.h, config/s390/linux.h, config/s390/tpf.md, config/s390/tpf.opt, config/s390/2064.md, config/s390/2084.md, config/s390/s390.md, config/s390/s390.opt, config/s390/s390-modes.def, config/s390/fixdfdi.h, config/s390/constraints.md, config/s390/s390-protos.h, config/s390/s390x.h, config/elfos.h, config/dbxcoff.h, config/m32c/predicates.md, config/m32c/cond.md, config/m32c/m32c.c, config/m32c/minmax.md, config/m32c/blkmov.md, config/m32c/m32c-pragma.c, config/m32c/m32c.h, config/m32c/prologue.md, config/m32c/m32c.abi, config/m32c/muldiv.md, config/m32c/bitops.md, config/m32c/mov.md, config/m32c/addsub.md, config/m32c/m32c.md, config/m32c/m32c.opt, config/m32c/t-m32c, config/m32c/m32c-modes.def, config/m32c/jump.md, config/m32c/shift.md, config/m32c/m32c-protos.h, config/libgloss.h, config/spu/spu-protos.h, config/spu/predicates.md, config/spu/spu-builtins.h, config/spu/spu.c, config/spu/spu-builtins.def, config/spu/spu-builtins.md, config/spu/spu.h, config/spu/spu-elf.h, config/spu/constraints.md, config/spu/spu.md, config/spu/spu-c.c, config/spu/spu.opt, config/spu/spu-modes.def, config/spu/t-spu-elf, config/interix.h, config/sparc/hypersparc.md, config/sparc/predicates.md, config/sparc/linux.h, config/sparc/sp64-elf.h, config/sparc/supersparc.md, config/sparc/cypress.md, config/sparc/openbsd1-64.h, config/sparc/openbsd64.h, config/sparc/niagara.md, config/sparc/sparc.md, config/sparc/long-double-switch.opt, config/sparc/ultra3.md, config/sparc/sparc.opt, config/sparc/sync.md, config/sparc/sp-elf.h, config/sparc/sparc-protos.h, config/sparc/ultra1_2.md, config/sparc/biarch64.h, config/sparc/sparc.c, config/sparc/little-endian.opt, config/sparc/sysv4-only.h, config/sparc/sparc.h, config/sparc/linux64.h, config/sparc/freebsd.h, config/sparc/sol2.h, config/sparc/rtemself.h, config/sparc/netbsd-elf.h, config/sparc/vxworks.h, config/sparc/sparc-modes.def, config/sparc/sparclet.md, config/sparc/sysv4.h, config/vx-common.h, config/netbsd-aout.h, config/flat.h, config/m32r/m32r.md, config/m32r/predicates.md, config/m32r/little.h, config/m32r/m32r.c, config/m32r/m32r.opt, config/m32r/linux.h, config/m32r/constraints.md, config/m32r/m32r.h, config/m32r/m32r-protos.h, config/vxworks.opt, config/darwin-c.c, config/darwin.opt, config/i386/i386.h, config/i386/cygming.h, config/i386/linux.h, config/i386/cygwin.h, config/i386/i386.md, config/i386/netware-crt0.c, config/i386/sco5.h, config/i386/mmx.md, config/i386/vx-common.h, config/i386/kaos-i386.h, config/i386/winnt-stubs.c, config/i386/netbsd64.h, config/i386/djgpp.h, config/i386/gas.h, config/i386/sol2.h, config/i386/constraints.md, config/i386/netware-libgcc.c, config/i386/sysv5.h, config/i386/predicates.md, config/i386/geode.md, config/i386/x86-64.h, config/i386/kfreebsd-gnu.h, config/i386/freebsd64.h, config/i386/vxworksae.h, config/i386/pentium.md, config/i386/lynx.h, config/i386/i386elf.h, config/i386/rtemself.h, config/i386/netbsd-elf.h, config/i386/ppro.md, config/i386/k6.md, config/i386/netware.c, config/i386/netware.h, config/i386/i386-modes.def, config/i386/sysv4-cpp.h, config/i386/i386-interix.h, config/i386/cygwin1.c, config/i386/djgpp.opt, config/i386/uwin.h, config/i386/unix.h, config/i386/ptx4-i.h, config/i386/xm-djgpp.h, config/i386/att.h, config/i386/winnt.c, config/i386/beos-elf.h, config/i386/sol2-10.h, config/i386/darwin64.h, config/i386/sse.md, config/i386/i386.opt, config/i386/bsd.h, config/i386/cygming.opt, config/i386/xm-mingw32.h, config/i386/linux64.h, config/i386/openbsdelf.h, config/i386/xm-cygwin.h, config/i386/sco5.opt, config/i386/darwin.h, config/i386/mingw32.h, config/i386/winnt-cxx.c, config/i386/i386-interix3.h, config/i386/nwld.c, config/i386/nwld.h, config/i386/host-cygwin.c, config/i386/cygwin2.c, config/i386/i386-protos.h, config/i386/sync.md, config/i386/openbsd.h, config/i386/host-mingw32.c, config/i386/i386-aout.h, config/i386/nto.h, config/i386/biarch64.h, config/i386/i386-coff.h, config/i386/freebsd.h, config/i386/driver-i386.c, config/i386/knetbsd-gnu.h, config/i386/host-i386-darwin.c, config/i386/vxworks.h, config/i386/crtdll.h, config/i386/i386.c, config/i386/sysv4.h, config/darwin-protos.h, config/linux.opt, config/sol2.c, config/sol2.h, config/sh/symbian.c, config/sh/sh-protos.h, config/sh/linux.h, config/sh/elf.h, config/sh/superh.h, config/sh/sh4.md, config/sh/coff.h, config/sh/newlib.h, config/sh/embed-elf.h, config/sh/symbian-pre.h, config/sh/rtems.h, config/sh/kaos-sh.h, config/sh/sh4a.md, config/sh/constraints.md, config/sh/sh64.h, config/sh/sh.opt, config/sh/symbian-post.h, config/sh/sh-c.c, config/sh/predicates.md, config/sh/sh.c, config/sh/sh.h, config/sh/shmedia.md, config/sh/sh-modes.def, config/sh/little.h, config/sh/sh1.md, config/sh/sh4-300.md, config/sh/superh64.h, config/sh/rtemself.h, config/sh/netbsd-elf.h, config/sh/sh.md, config/sh/vxworks.h, config/usegas.h, config/svr3.h, config/pdp11/pdp11-protos.h, config/pdp11/2bsd.h, config/pdp11/pdp11.md, config/pdp11/pdp11.c, config/pdp11/pdp11.opt, config/pdp11/pdp11-modes.def, config/pdp11/pdp11.h, config/avr/rtems.h, config/avr/avr-protos.h, config/avr/predicates.md, config/avr/constraints.md, config/avr/avr.md, config/avr/avr.c, config/avr/avr.opt, config/avr/avr.h, config/sol2-protos.h, config/dbxelf.h, config/lynx.opt, config/crx/crx.h, config/crx/crx-protos.h, config/crx/crx.md, config/crx/crx.c, config/crx/crx.opt, config/c4x/c4x-c.c, config/c4x/c4x.c, config/c4x/c4x.opt, config/c4x/c4x-modes.def, config/c4x/rtems.h, config/c4x/predicates.md, config/c4x/c4x.h, config/c4x/c4x-protos.h, config/c4x/c4x.md, config/kfreebsd-gnu.h, config/xtensa/predicates.md, config/xtensa/xtensa.c, config/xtensa/linux.h, config/xtensa/xtensa.h, config/xtensa/elf.h, config/xtensa/xtensa.md, config/xtensa/xtensa.opt, config/xtensa/constraints.md, config/xtensa/xtensa-protos.h, config/dbx.h, config/stormy16/predicates.md, config/stormy16/stormy16.md, config/stormy16/stormy16.c, config/stormy16/stormy16.opt, config/stormy16/stormy16.h, config/stormy16/stormy16-protos.h, config/host-solaris.c, config/fr30/fr30.h, config/fr30/predicates.md, config/fr30/fr30-protos.h, config/fr30/fr30.md, config/fr30/fr30.c, config/fr30/fr30.opt, config/vxworksae.h, config/sol2-c.c, config/lynx.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/predicates.md, config/m68hc11/m68hc11.md, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.opt, config/m68hc11/m68hc11.h, config/m68hc11/m68hc12.h, config/openbsd-oldgas.h, config/host-linux.c, config/interix3.h, config/cris/cris.c, config/cris/predicates.md, config/cris/linux.h, config/cris/cris.h, config/cris/aout.h, config/cris/cris.md, config/cris/linux.opt, config/cris/cris.opt, config/cris/elf.opt, config/cris/aout.opt, config/cris/cris-protos.h, config/vxworks-dummy.h, config/netbsd.h, config/netbsd-elf.h, config/iq2000/iq2000.h, config/iq2000/predicates.md, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.md, config/iq2000/iq2000.c, config/iq2000/iq2000.opt, config/host-darwin.c, config/mt/mt.md, config/mt/mt.c, config/mt/mt.opt, config/mt/t-mt, config/mt/mt.h, config/mt/mt-protos.h, config/svr4.h, config/host-darwin.h, config/chorus.h, config/mn10300/mn10300.c, config/mn10300/mn10300.opt, config/mn10300/predicates.md, config/mn10300/mn10300.h, config/mn10300/linux.h, config/mn10300/constraints.md, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.md, config/ia64/predicates.md, config/ia64/itanium1.md, config/ia64/unwind-ia64.h, config/ia64/ia64-c.c, config/ia64/sync.md, config/ia64/ia64.c, config/ia64/itanium2.md, config/ia64/ia64.h, config/ia64/vect.md, config/ia64/freebsd.h, config/ia64/ia64.md, config/ia64/ia64-modes.def, config/ia64/constraints.md, config/ia64/hpux.h, config/ia64/ia64-protos.h, config/windiss.h, config/gofast.h, config/rtems.h, config/sol2-10.h, config/m68k/predicates.md, config/m68k/m68k.md, config/m68k/linux.h, config/m68k/m68k-modes.def, config/m68k/print-sysroot-suffix.sh, config/m68k/m68k-protos.h, config/m68k/coff.h, config/m68k/m68k-none.h, config/m68k/ieee.opt, config/m68k/openbsd.h, config/m68k/m68k-aout.h, config/m68k/m68k.opt, config/m68k/m68020-elf.h, config/m68k/m68kelf.h, config/m68k/m68k-devices.def, config/m68k/uclinux-oldabi.h, config/m68k/m68k.c, config/m68k/constraints.md, config/m68k/rtemself.h, config/m68k/netbsd-elf.h, config/m68k/m68k.h, config/m68k/uclinux.h, config/rs6000/power4.md, config/rs6000/host-darwin.c, config/rs6000/6xx.md, config/rs6000/linux.h, config/rs6000/eabi.h, config/rs6000/aix41.opt, config/rs6000/xcoff.h, config/rs6000/secureplt.h, config/rs6000/linuxspe.h, config/rs6000/eabialtivec.h, config/rs6000/8540.md, config/rs6000/darwin8.h, config/rs6000/kaos-ppc.h, config/rs6000/windiss.h, config/rs6000/603.md, config/rs6000/aix41.h, config/rs6000/cell.md, config/rs6000/mpc.md, config/rs6000/aix43.h, config/rs6000/beos.h, config/rs6000/gnu.h, config/rs6000/rtems.h, config/rs6000/aix.opt, config/rs6000/darwin.md, config/rs6000/darwin64.h, config/rs6000/default64.h, config/rs6000/7xx.md, config/rs6000/darwin.opt, config/rs6000/spe.md, config/rs6000/rs6000.opt, config/rs6000/rs6000-c.c, config/rs6000/rios2.md, config/rs6000/linuxaltivec.h, config/rs6000/7450.md, config/rs6000/linux64.h, config/rs6000/constraints.md, config/rs6000/440.md, config/rs6000/darwin.h, config/rs6000/host-ppc64-darwin.c, config/rs6000/rs6000.c, config/rs6000/aix52.h, config/rs6000/rs6000.h, config/rs6000/power6.md, config/rs6000/predicates.md, config/rs6000/altivec.md, config/rs6000/aix64.opt, config/rs6000/rios1.md, config/rs6000/rs6000-modes.def, config/rs6000/rs64.md, config/rs6000/eabisim.h, config/rs6000/sysv4le.h, config/rs6000/darwin7.h, config/rs6000/dfp.md, config/rs6000/linux64.opt, config/rs6000/sync.md, config/rs6000/vxworksae.h, config/rs6000/power5.md, config/rs6000/lynx.h, config/rs6000/biarch64.h, config/rs6000/rs6000.md, config/rs6000/sysv4.opt, config/rs6000/eabispe.h, config/rs6000/e500.h, config/rs6000/freebsd.h, config/rs6000/rs6000-protos.h, config/rs6000/netbsd.h, config/rs6000/e500-double.h, config/rs6000/aix.h, config/rs6000/vxworks.h, config/rs6000/40x.md, config/rs6000/aix51.h, config/rs6000/sysv4.h, config/arc/arc-protos.h, config/arc/arc.md, config/arc/arc.c, config/arc/arc.opt, config/arc/arc-modes.def, config/arc/arc.h, config/mcore/mcore-elf.h, config/mcore/mcore-protos.h, config/mcore/predicates.md, config/mcore/mcore.md, config/mcore/mcore.c, config/mcore/mcore.opt, config/mcore/mcore.h, config/mcore/mcore-pe.h, config/darwin.c, config/freebsd-nthr.h, config/score/predicates.md, config/score/score-version.h, config/score/score-protos.h, config/score/misc.md, config/score/elf.h, config/score/score.c, config/score/mac.md, config/score/score7.md, config/score/score.h, config/score/score-conv.h, config/score/score-mdaux.c, config/score/score.md, config/score/score.opt, config/score/score-modes.def, config/score/score-mdaux.h, config/score/mul-div.S, config/arm/uclinux-elf.h, config/arm/semi.h, config/arm/ecos-elf.h, config/arm/arm1020e.md, config/arm/symbian.h, config/arm/linux-elf.h, config/arm/arm1026ejs.md, config/arm/arm1136jfs.md, config/arm/elf.h, config/arm/aout.h, config/arm/arm.c, config/arm/thumb2.md, config/arm/vec-common.md, config/arm/coff.h, config/arm/strongarm-pe.h, config/arm/arm.h, config/arm/cortex-a8-neon.md, config/arm/semiaof.h, config/arm/cortex-a8.md, config/arm/uclinux-eabi.h, config/arm/arm-modes.def, config/arm/linux-eabi.h, config/arm/rtems-elf.h, config/arm/neon-schedgen.ml, config/arm/arm-cores.def, config/arm/arm-protos.h, config/arm/vfp.md, config/arm/aof.h, config/arm/linux-gas.h, config/arm/wince-pe.h, config/arm/neon.md, config/arm/constraints.md, config/arm/neon.ml, config/arm/xscale-elf.h, config/arm/strongarm-coff.h, config/arm/arm.opt, config/arm/arm926ejs.md, config/arm/predicates.md, config/arm/iwmmxt.md, config/arm/arm_neon.h, config/arm/unknown-elf.h, config/arm/kaos-arm.h, config/arm/bpabi.h, config/arm/pe.opt, config/arm/neon-testgen.ml, config/arm/arm.md, config/arm/xscale-coff.h, config/arm/pe.c, config/arm/arm-generic.md, config/arm/pe.h, config/arm/kaos-strongarm.h, config/arm/freebsd.h, config/arm/neon-docgen.ml, config/arm/netbsd.h, config/arm/fpa.md, config/arm/strongarm-elf.h, config/arm/cirrus.md, config/arm/netbsd-elf.h, config/arm/vxworks.h, config/arm/neon-gen.ml, config/kaos.h, config/darwin-driver.c, config/pa/predicates.md, config/pa/pa64-hpux.h, config/pa/pa-hpux.opt, config/pa/som.h, config/pa/pa-hpux1010.opt, config/pa/pa-hpux1111.opt, config/pa/pa-pro-end.h, config/pa/elf.h, config/pa/fptr.c, config/pa/pa64-linux.h, config/pa/pa.md, config/pa/pa.opt, config/pa/pa-hpux.h, config/pa/pa-hpux10.h, config/pa/pa-hpux11.h, config/pa/pa-hpux1010.h, config/pa/pa-protos.h, config/pa/pa-osf.h, config/pa/pa-hpux1111.h, config/pa/pa-64.h, config/pa/milli64.S, config/pa/pa.c, config/pa/pa-linux.h, config/pa/pa.h, config/pa/pa32-linux.h, config/pa/pa64-hpux.opt, config/pa/pa64-regs.h, config/pa/pa-modes.def, config/pa/constraints.md, config/darwin9.h, config/mips/4100.md, config/mips/linux.h, config/mips/elfoabi.h, config/mips/elf.h, config/mips/sdb.h, config/mips/windiss.h, config/mips/rtems.h, config/mips/3000.md, config/mips/iris5.h, config/mips/5000.md, config/mips/7000.md, config/mips/9000.md, config/mips/4600.md, config/mips/linux64.h, config/mips/elforion.h, config/mips/constraints.md, config/mips/generic.md, config/mips/predicates.md, config/mips/4300.md, config/mips/mips-ps-3d.md, config/mips/iris.h, config/mips/24k.md, config/mips/mips.md, config/mips/mips.opt, config/mips/4k.md, config/mips/5k.md, config/mips/vr4120-div.S, config/mips/openbsd.h, config/mips/iris6.h, config/mips/4000.md, config/mips/mips-protos.h, config/mips/6000.md, config/mips/mips.c, config/mips/mips.h, config/mips/r3900.h, config/mips/74k.md, config/mips/netbsd.h, config/mips/vxworks.h, config/mips/mips-modes.def, config/mips/vr.h, config/soft-fp/t-softfp, config/openbsd.h, config/ptx4.h, config/freebsd-spec.h, config/vax/vax.c, config/vax/openbsd.h, config/vax/vax.h, config/vax/elf.h, config/vax/vax.md, config/vax/bsd.h, config/vax/vax.opt, config/vax/vax-modes.def, config/vax/openbsd1.h, config/vax/netbsd.h, config/vax/vax-protos.h, config/vax/netbsd-elf.h, config/vax/vaxv.h, config/vax/ultrix.h, config/freebsd.h, config/h8300/rtems.h, config/h8300/predicates.md, config/h8300/h8300.c, config/h8300/h8300.h, config/h8300/elf.h, config/h8300/h8300.md, config/h8300/h8300.opt, config/h8300/coff.h, config/h8300/h8300-protos.h, config/v850/v850.md, config/v850/predicates.md, config/v850/v850-c.c, config/v850/v850.c, config/v850/v850.opt, config/v850/v850.h, config/v850/v850-protos.h, config/vxworks.c, config/knetbsd-gnu.h, config/sol2-6.h, config/vxworks.h, config/mmix/mmix.h, config/mmix/predicates.md, config/mmix/mmix-protos.h, config/mmix/mmix.md, config/mmix/mmix.c, config/mmix/mmix.opt, config/mmix/mmix-modes.def, config/bfin/bfin.opt, config/bfin/rtems.h, config/bfin/bfin-modes.def, config/bfin/predicates.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/bfin/bfin.h, config/bfin/bfin.md: Likewise. From-SVN: r127157
2007-08-02 12:49:31 +02:00
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
1992-02-06 21:09:50 +01:00
#include "config.h"
Warning fixes: * Makefile.in (varasm.o): Depend on dbxout.h. (cse.o): Depend on toplev.h and output.h. (gcse.o): Depend on output.h. * mips.c: Include system.h and toplev.h and remove redundant code. Include output.h after tree.h so all its prototypes get activated. * mips.md (table_jump): Remove unused variable `dest'. * sparc.h: Add prototype for `v8plus_regcmp_op'. * crtstuff.c (fini_dummy, init_dummy): Mark function definitions with __attribute__ ((__unused__)). (__frame_dummy): Provide prototype before use, wrap it with EH_FRAME_SECTION_ASM_OP. * cse.c: Move inclusion of <setjmp.h> above local headers. Include toplev.h and output.h. * dbxout.h: Add prototype for `dbxout_begin_function'. * final.c (final_scan_insn): Wrap variable `max_skip' in macro ASM_OUTPUT_MAX_SKIP_ALIGN. * gcse.c: Include system.h and output.h. (dump_cuid_table, dump_rd_table, dump_cprop_data, dump_pre_data): Make extern instead of static. (compute_can_copy): Only declare variables `reg' and `insn' when AVOID_CCMODE_COPIES is not defined. (record_set_info): Mark parameter `setter' with ATTRIBUTE_UNUSED. (hash_scan_clobber): Likewise for `x' and `insn'. (hash_scan_call): Likewise. (record_last_set_info): Likewise for `setter'. (mark_call): Likewise for `pat'. (pre_insert_insn): Wrap variable `note' in macro HAVE_cc0. * libgcc2.c (__bb_init_prg): Replace bzero with memset and fix the length parameter so that it multiplies the number of elements by the sizeof(element). * output.h: Add prototype for `weak_finish'. * recog.h: Likewise for `validate_replace_src'. * rtl.h: Likewise for `optimize_save_area_alloca', `fix_sched_param', `purge_addressof', `gcse_main', `regmove_optimize', `dbr_schedule', `branch_prob' and `end_branch_prob'. * toplev.h: Likewise for `set_float_handler' and `output_quoted_string'. * varasm.c: Include dbxout.h. From-SVN: r20351
1998-06-08 20:30:27 +02:00
#include "system.h"
#include "coretypes.h"
#include "tm.h"
Warning fixes: * Makefile.in (varasm.o): Depend on dbxout.h. (cse.o): Depend on toplev.h and output.h. (gcse.o): Depend on output.h. * mips.c: Include system.h and toplev.h and remove redundant code. Include output.h after tree.h so all its prototypes get activated. * mips.md (table_jump): Remove unused variable `dest'. * sparc.h: Add prototype for `v8plus_regcmp_op'. * crtstuff.c (fini_dummy, init_dummy): Mark function definitions with __attribute__ ((__unused__)). (__frame_dummy): Provide prototype before use, wrap it with EH_FRAME_SECTION_ASM_OP. * cse.c: Move inclusion of <setjmp.h> above local headers. Include toplev.h and output.h. * dbxout.h: Add prototype for `dbxout_begin_function'. * final.c (final_scan_insn): Wrap variable `max_skip' in macro ASM_OUTPUT_MAX_SKIP_ALIGN. * gcse.c: Include system.h and output.h. (dump_cuid_table, dump_rd_table, dump_cprop_data, dump_pre_data): Make extern instead of static. (compute_can_copy): Only declare variables `reg' and `insn' when AVOID_CCMODE_COPIES is not defined. (record_set_info): Mark parameter `setter' with ATTRIBUTE_UNUSED. (hash_scan_clobber): Likewise for `x' and `insn'. (hash_scan_call): Likewise. (record_last_set_info): Likewise for `setter'. (mark_call): Likewise for `pat'. (pre_insert_insn): Wrap variable `note' in macro HAVE_cc0. * libgcc2.c (__bb_init_prg): Replace bzero with memset and fix the length parameter so that it multiplies the number of elements by the sizeof(element). * output.h: Add prototype for `weak_finish'. * recog.h: Likewise for `validate_replace_src'. * rtl.h: Likewise for `optimize_save_area_alloca', `fix_sched_param', `purge_addressof', `gcse_main', `regmove_optimize', `dbr_schedule', `branch_prob' and `end_branch_prob'. * toplev.h: Likewise for `set_float_handler' and `output_quoted_string'. * varasm.c: Include dbxout.h. From-SVN: r20351
1998-06-08 20:30:27 +02:00
#include <signal.h>
1992-02-06 21:09:50 +01:00
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
#include "insn-attr.h"
#include "recog.h"
Warning fixes: * Makefile.in (varasm.o): Depend on dbxout.h. (cse.o): Depend on toplev.h and output.h. (gcse.o): Depend on output.h. * mips.c: Include system.h and toplev.h and remove redundant code. Include output.h after tree.h so all its prototypes get activated. * mips.md (table_jump): Remove unused variable `dest'. * sparc.h: Add prototype for `v8plus_regcmp_op'. * crtstuff.c (fini_dummy, init_dummy): Mark function definitions with __attribute__ ((__unused__)). (__frame_dummy): Provide prototype before use, wrap it with EH_FRAME_SECTION_ASM_OP. * cse.c: Move inclusion of <setjmp.h> above local headers. Include toplev.h and output.h. * dbxout.h: Add prototype for `dbxout_begin_function'. * final.c (final_scan_insn): Wrap variable `max_skip' in macro ASM_OUTPUT_MAX_SKIP_ALIGN. * gcse.c: Include system.h and output.h. (dump_cuid_table, dump_rd_table, dump_cprop_data, dump_pre_data): Make extern instead of static. (compute_can_copy): Only declare variables `reg' and `insn' when AVOID_CCMODE_COPIES is not defined. (record_set_info): Mark parameter `setter' with ATTRIBUTE_UNUSED. (hash_scan_clobber): Likewise for `x' and `insn'. (hash_scan_call): Likewise. (record_last_set_info): Likewise for `setter'. (mark_call): Likewise for `pat'. (pre_insert_insn): Wrap variable `note' in macro HAVE_cc0. * libgcc2.c (__bb_init_prg): Replace bzero with memset and fix the length parameter so that it multiplies the number of elements by the sizeof(element). * output.h: Add prototype for `weak_finish'. * recog.h: Likewise for `validate_replace_src'. * rtl.h: Likewise for `optimize_save_area_alloca', `fix_sched_param', `purge_addressof', `gcse_main', `regmove_optimize', `dbr_schedule', `branch_prob' and `end_branch_prob'. * toplev.h: Likewise for `set_float_handler' and `output_quoted_string'. * varasm.c: Include dbxout.h. From-SVN: r20351
1998-06-08 20:30:27 +02:00
#include "toplev.h"
#include "output.h"
1992-02-06 21:09:50 +01:00
#include "tree.h"
#include "function.h"
1992-02-06 21:09:50 +01:00
#include "expr.h"
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
#include "optabs.h"
#include "libfuncs.h"
1992-02-06 21:09:50 +01:00
#include "flags.h"
#include "reload.h"
#include "tm_p.h"
#include "ggc.h"
#include "gstab.h"
#include "hashtab.h"
#include "debug.h"
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
#include "target.h"
#include "target-def.h"
#include "integrate.h"
#include "langhooks.h"
#include "cfglayout.h"
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
#include "sched-int.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 rtl-optimization/24762 ([killloop-branch] code motion of non-invariant expressions with hard registers.) 2006-01-27 Daniel Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> PR rtl-optimization/24762 * doc/tm.texi: Added TARGET_EXTRA_LIVE_ON_ENTRY. * targhooks.c (hook_void_bitmap): New hook prototype. * targhoohs.h (hook_void_bitmap): Ditto. * bitmap.h (bitmap_head_def): Moved to coretypes.h. * coretypes.h (bitmap_head_def): Moved from bitmap.h. * target.h (live_on_entry): New function pointer. * df-scan.c (df_all_hard_regs): Removed. (df_scan_dump, df_hard_reg_init): Removed df_all_hard_regs. (df_scan_free_internal): Added df->entry_block_defs. (df_scan_alloc): Ditto. (df_scan_dump): Ditto. (df_uses_record): Plumbed flag field properly thru calls. Record EH_RETURN_DATA_REGNO in eh blocks unconditionally. This part fixes PR24762. (df_bb_refs_record): Added code to make the frame and arg pointers live in EH blocks. (df_refs_record): Added call to df_record_entry_block_defs. (df_record_entry_block_defs): New function. * df-core.c: Added comments to describe new artifical defs. * df.h (DF_REF_DIES_AFTER_THIS_USE): New flag in enum df_ref_flags. (entry_block_defs): New field in struct df. (df_all_hard_regs): Deleted. * target-def.h: Added TARGET_EXTRA_LIVE_ON_ENTRY. * df-problems.c (df_ru_bb_local_compute_process_def): Added code to handle artifical defs in the entry to a function. (df_ru_bb_local_compute): Ditto. (df_rd_bb_local_compute_process_def): Ditto. (df_rd_bb_local_compute): Ditto. (df_lr_bb_local_compute): Ditto. (df_ur_bb_local_compute): Ditto. (df_urec_bb_local_compute): Ditto. (df_chain_create_bb): Ditto. (df_ur_local_finalize): Removed entry. (df_urec_init): Ditto. (df_urec_local_finalize): Ditto. (df_ri_bb_compute): Added detection of last use of pseudos. * Makefile.in (df-scan.o): Updated dependencies. * config/mips/mips-protos.h (mips_set_live_on_entry): Added. * config/mips/mips.c (mips_set_live_on_entry): Added. * config/mips/mips.c (TARGET_EXTRA_LIVE_ON_ENTRY): Added value for target hook. * dce.c (marked_insn_p): Added code to handle artifical defs. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r110312
2006-01-27 23:23:32 +01:00
#include "bitmap.h"
#include "diagnostic.h"
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
#define UNSPEC_ADDRESS_P(X) \
(GET_CODE (X) == UNSPEC \
&& XINT (X, 1) >= UNSPEC_ADDRESS_FIRST \
&& XINT (X, 1) < UNSPEC_ADDRESS_FIRST + NUM_SYMBOL_TYPES)
/* Extract the symbol or label from UNSPEC wrapper X. */
#define UNSPEC_ADDRESS(X) \
XVECEXP (X, 0, 0)
/* Extract the symbol type from UNSPEC wrapper X. */
#define UNSPEC_ADDRESS_TYPE(X) \
((enum mips_symbol_type) (XINT (X, 1) - UNSPEC_ADDRESS_FIRST))
/* The maximum distance between the top of the stack frame and the
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
value $sp has when we save and restore registers.
The value for normal-mode code must be a SMALL_OPERAND and must
preserve the maximum stack alignment. We therefore use a value
of 0x7ff0 in this case.
MIPS16e SAVE and RESTORE instructions can adjust the stack pointer by
up to 0x7f8 bytes and can usually save or restore all the registers
that we need to save or restore. (Note that we can only use these
instructions for o32, for which the stack alignment is 8 bytes.)
We use a maximum gap of 0x100 or 0x400 for MIPS16 code when SAVE and
RESTORE are not available. We can then use unextended instructions
to save and restore registers, and to allocate and deallocate the top
part of the frame. */
#define MIPS_MAX_FIRST_STACK_STEP \
(!TARGET_MIPS16 ? 0x7ff0 \
: GENERATE_MIPS16E_SAVE_RESTORE ? 0x7f8 \
: TARGET_64BIT ? 0x100 : 0x400)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* True if INSN is a mips.md pattern or asm statement. */
#define USEFUL_INSN_P(INSN) \
(INSN_P (INSN) \
&& GET_CODE (PATTERN (INSN)) != USE \
&& GET_CODE (PATTERN (INSN)) != CLOBBER \
&& GET_CODE (PATTERN (INSN)) != ADDR_VEC \
&& GET_CODE (PATTERN (INSN)) != ADDR_DIFF_VEC)
/* If INSN is a delayed branch sequence, return the first instruction
in the sequence, otherwise return INSN itself. */
#define SEQ_BEGIN(INSN) \
(INSN_P (INSN) && GET_CODE (PATTERN (INSN)) == SEQUENCE \
? XVECEXP (PATTERN (INSN), 0, 0) \
: (INSN))
/* Likewise for the last instruction in a delayed branch sequence. */
#define SEQ_END(INSN) \
(INSN_P (INSN) && GET_CODE (PATTERN (INSN)) == SEQUENCE \
? XVECEXP (PATTERN (INSN), 0, XVECLEN (PATTERN (INSN), 0) - 1) \
: (INSN))
/* Execute the following loop body with SUBINSN set to each instruction
between SEQ_BEGIN (INSN) and SEQ_END (INSN) inclusive. */
#define FOR_EACH_SUBINSN(SUBINSN, INSN) \
for ((SUBINSN) = SEQ_BEGIN (INSN); \
(SUBINSN) != NEXT_INSN (SEQ_END (INSN)); \
(SUBINSN) = NEXT_INSN (SUBINSN))
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* True if bit BIT is set in VALUE. */
#define BITSET_P(VALUE, BIT) (((VALUE) & (1 << (BIT))) != 0)
/* Classifies an address.
ADDRESS_REG
A natural register + offset address. The register satisfies
mips_valid_base_register_p and the offset is a const_arith_operand.
ADDRESS_LO_SUM
A LO_SUM rtx. The first operand is a valid base register and
the second operand is a symbolic address.
ADDRESS_CONST_INT
A signed 16-bit constant address.
ADDRESS_SYMBOLIC:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
A constant symbolic address. */
enum mips_address_type {
ADDRESS_REG,
ADDRESS_LO_SUM,
ADDRESS_CONST_INT,
ADDRESS_SYMBOLIC
};
/* Macros to create an enumeration identifier for a function prototype. */
#define MIPS_FTYPE_NAME1(A, B) MIPS_##A##_FTYPE_##B
#define MIPS_FTYPE_NAME2(A, B, C) MIPS_##A##_FTYPE_##B##_##C
#define MIPS_FTYPE_NAME3(A, B, C, D) MIPS_##A##_FTYPE_##B##_##C##_##D
#define MIPS_FTYPE_NAME4(A, B, C, D, E) MIPS_##A##_FTYPE_##B##_##C##_##D##_##E
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Classifies the prototype of a built-in function. */
enum mips_function_type {
#define DEF_MIPS_FTYPE(NARGS, LIST) MIPS_FTYPE_NAME##NARGS LIST,
#include "config/mips/mips-ftypes.def"
#undef DEF_MIPS_FTYPE
MIPS_MAX_FTYPE_MAX
};
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Specifies how a built-in function should be converted into rtl. */
enum mips_builtin_type {
/* The function corresponds directly to an .md pattern. The return
value is mapped to operand 0 and the arguments are mapped to
operands 1 and above. */
MIPS_BUILTIN_DIRECT,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The function corresponds directly to an .md pattern. There is no return
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
value and the arguments are mapped to operands 0 and above. */
MIPS_BUILTIN_DIRECT_NO_TARGET,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The function corresponds to a comparison instruction followed by
a mips_cond_move_tf_ps pattern. The first two arguments are the
values to compare and the second two arguments are the vector
operands for the movt.ps or movf.ps instruction (in assembly order). */
MIPS_BUILTIN_MOVF,
MIPS_BUILTIN_MOVT,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The function corresponds to a V2SF comparison instruction. Operand 0
of this instruction is the result of the comparison, which has mode
CCV2 or CCV4. The function arguments are mapped to operands 1 and
above. The function's return value is an SImode boolean that is
true under the following conditions:
MIPS_BUILTIN_CMP_ANY: one of the registers is true
MIPS_BUILTIN_CMP_ALL: all of the registers are true
MIPS_BUILTIN_CMP_LOWER: the first register is true
MIPS_BUILTIN_CMP_UPPER: the second register is true. */
MIPS_BUILTIN_CMP_ANY,
MIPS_BUILTIN_CMP_ALL,
MIPS_BUILTIN_CMP_UPPER,
MIPS_BUILTIN_CMP_LOWER,
/* As above, but the instruction only sets a single $fcc register. */
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
MIPS_BUILTIN_CMP_SINGLE,
/* For generating bposge32 branch instructions in MIPS32 DSP ASE. */
MIPS_BUILTIN_BPOSGE32
};
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Invoke MACRO (COND) for each C.cond.fmt condition. */
#define MIPS_FP_CONDITIONS(MACRO) \
MACRO (f), \
MACRO (un), \
MACRO (eq), \
MACRO (ueq), \
MACRO (olt), \
MACRO (ult), \
MACRO (ole), \
MACRO (ule), \
MACRO (sf), \
MACRO (ngle), \
MACRO (seq), \
MACRO (ngl), \
MACRO (lt), \
MACRO (nge), \
MACRO (le), \
MACRO (ngt)
/* Enumerates the codes above as MIPS_FP_COND_<X>. */
#define DECLARE_MIPS_COND(X) MIPS_FP_COND_ ## X
enum mips_fp_condition {
MIPS_FP_CONDITIONS (DECLARE_MIPS_COND)
};
/* Index X provides the string representation of MIPS_FP_COND_<X>. */
#define STRINGIFY(X) #X
static const char *const mips_fp_conditions[] = {
MIPS_FP_CONDITIONS (STRINGIFY)
};
/* Information about a function's frame layout. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
struct mips_frame_info GTY(()) {
/* The size of the frame in bytes. */
HOST_WIDE_INT total_size;
/* The number of bytes allocated to variables. */
HOST_WIDE_INT var_size;
/* The number of bytes allocated to outgoing function arguments. */
HOST_WIDE_INT args_size;
/* The number of bytes allocated to the .cprestore slot, or 0 if there
is no such slot. */
HOST_WIDE_INT cprestore_size;
/* Bit X is set if the function saves or restores GPR X. */
unsigned int mask;
/* Likewise FPR X. */
unsigned int fmask;
/* The number of GPRs and FPRs saved. */
unsigned int num_gp;
unsigned int num_fp;
/* The offset of the topmost GPR and FPR save slots from the top of
the frame, or zero if no such slots are needed. */
HOST_WIDE_INT gp_save_offset;
HOST_WIDE_INT fp_save_offset;
/* Likewise, but giving offsets from the bottom of the frame. */
HOST_WIDE_INT gp_sp_offset;
HOST_WIDE_INT fp_sp_offset;
/* The offset of arg_pointer_rtx from frame_pointer_rtx. */
HOST_WIDE_INT arg_pointer_offset;
/* The offset of hard_frame_pointer_rtx from frame_pointer_rtx. */
HOST_WIDE_INT hard_frame_pointer_offset;
};
struct machine_function GTY(()) {
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The register returned by mips16_gp_pseudo_reg; see there for details. */
rtx mips16_gp_pseudo_rtx;
/* The number of extra stack bytes taken up by register varargs.
This area is allocated by the callee at the very top of the frame. */
int varargs_size;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The current frame information, calculated by mips_compute_frame_info. */
struct mips_frame_info frame;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The register to use as the function's global pointer. */
mips.h (GLOBAL_POINTER_REGNUM): New macro. * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for n32/64 PIC. (MUST_SAVE_REGISTERS): Delete. * config/mips/mips.c (mips_frame_info): Remove extra_size field. (machine_function): Add global_pointer field. (mips_classify_constant): Check for (const $gp) using pointer equality with pic_offset_table_rtx. (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_restore_gp): Use current_function_outgoing_args_size. (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of GP_REG_FIRST + 28. Handle relocation strings that have more than one '('. (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_global_pointer): New function. (mips_save_reg_p): New function, mostly split out from... (compute_frame_size): ...here. Remove handling of extra_size. Reclaim args_size if no variables depend on it. Don't treat gp as a special case: handle it in the main GPR loop. (mips_initial_elimination_offset): Fix comment. (save_restore_insns): Save every register in the GPR mask, removing distinction between mask and real_mask. (mips_output_function_prologue): Update .frame psuedo-op after the removal of extra_size. Move the SVR4 PIC stack allocation and cprestore instructions to mips_expand_prologue. (mips_gp_insn): New function. (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to the chosen global pointer. Handle SVR4 PIC stack allocation in the same way as other ABIs. Adjust varargs code accordingly. Emit a cprestore insn after allocating the stack. Use mips_gp_insn to emit the loadgp sequence. Follow it with a loadgp_blockage if not using explicit relocs. (mips_output_function_epilogue): Reinstate the default gp register. (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. (mips16_optimize_gp): Likewise. * config/mips/mips.md (UNSPEC_LOADGP): Remove. (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. (loadgp): Remove. (loadgp_blockage, cprestore): New instructions. (builtin_setjmp_setup): Implement using emit_move_insn. Use pic_offset_table_rtx. (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. (builtin_longjmp): Use gen_raw_REG to force use of $28. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r67656
2003-06-09 09:19:14 +02:00
unsigned int global_pointer;
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
/* True if mips_adjust_insn_length should ignore an instruction's
hazard attribute. */
bool ignore_hazard_length_p;
/* True if the whole function is suitable for .set noreorder and
.set nomacro. */
bool all_noreorder_p;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
/* True if the function is known to have an instruction that needs $gp. */
bool has_gp_insn_p;
/* True if we have emitted an instruction to initialize
mips16_gp_pseudo_rtx. */
bool initialized_mips16_gp_pseudo_p;
};
2002-03-22 10:55:03 +01:00
/* Information about a single argument. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
struct mips_arg_info {
2002-03-22 10:55:03 +01:00
/* True if the argument is passed in a floating-point register, or
would have been if we hadn't run out of registers. */
bool fpr_p;
/* The number of words passed in registers, rounded up. */
unsigned int reg_words;
/* For EABI, the offset of the first register from GP_ARG_FIRST or
FP_ARG_FIRST. For other ABIs, the offset of the first register from
the start of the ABI's argument structure (see the CUMULATIVE_ARGS
comment for details).
The value is MAX_ARGS_IN_REGISTERS if the argument is passed entirely
2002-03-22 10:55:03 +01:00
on the stack. */
unsigned int reg_offset;
/* The number of words that must be passed on the stack, rounded up. */
unsigned int stack_words;
/* The offset from the start of the stack overflow area of the argument's
first stack word. Only meaningful when STACK_WORDS is nonzero. */
2002-03-22 10:55:03 +01:00
unsigned int stack_offset;
};
/* Information about an address described by mips_address_type.
ADDRESS_CONST_INT
No fields are used.
ADDRESS_REG
REG is the base register and OFFSET is the constant offset.
ADDRESS_LO_SUM
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
REG and OFFSET are the operands to the LO_SUM and SYMBOL_TYPE
is the type of symbol it references.
ADDRESS_SYMBOLIC
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
SYMBOL_TYPE is the type of symbol that the address references. */
struct mips_address_info {
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
enum mips_address_type type;
rtx reg;
rtx offset;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
enum mips_symbol_type symbol_type;
};
/* One stage in a constant building sequence. These sequences have
the form:
A = VALUE[0]
A = A CODE[1] VALUE[1]
A = A CODE[2] VALUE[2]
...
where A is an accumulator, each CODE[i] is a binary rtl operation
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
and each VALUE[i] is a constant integer. CODE[0] is undefined. */
struct mips_integer_op {
enum rtx_code code;
unsigned HOST_WIDE_INT value;
};
/* The largest number of operations needed to load an integer constant.
The worst accepted case for 64-bit constants is LUI,ORI,SLL,ORI,SLL,ORI.
When the lowest bit is clear, we can try, but reject a sequence with
an extra SLL at the end. */
#define MIPS_MAX_INTEGER_OPS 7
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Information about a MIPS16e SAVE or RESTORE instruction. */
struct mips16e_save_restore_info {
/* The number of argument registers saved by a SAVE instruction.
0 for RESTORE instructions. */
unsigned int nargs;
/* Bit X is set if the instruction saves or restores GPR X. */
unsigned int mask;
/* The total number of bytes to allocate. */
HOST_WIDE_INT size;
};
1992-02-06 21:09:50 +01:00
/* Global variables for machine-dependent things. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The -G setting, or the configuration's default small-data limit if
no -G option is given. */
static unsigned int mips_small_data_threshold;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The number of file directives written by mips_output_filename. */
int num_source_filenames;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The name that appeared in the last .file directive written by
mips_output_filename, or "" if mips_output_filename hasn't
written anything yet. */
const char *current_function_file = "";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* A label counter used by PUT_SDB_BLOCK_START and PUT_SDB_BLOCK_END. */
int sdb_label_count;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Arrays that map GCC register numbers to debugger register numbers. */
int mips_dbx_regno[FIRST_PSEUDO_REGISTER];
int mips_dwarf_regno[FIRST_PSEUDO_REGISTER];
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The nesting depth of the PRINT_OPERAND '%(', '%<' and '%[' constructs. */
1992-02-06 21:09:50 +01:00
int set_noreorder;
int set_nomacro;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
static int set_noat;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* True if we're writing out a branch-likely instruction rather than a
normal branch. */
static bool mips_branch_likely;
1992-02-06 21:09:50 +01:00
/* The operands passed to the last cmpMM expander. */
rtx cmp_operands[2];
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The current instruction-set architecture. */
enum processor_type mips_arch;
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
const struct mips_cpu_info *mips_arch_info;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The processor that we should tune the code for. */
enum processor_type mips_tune;
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
const struct mips_cpu_info *mips_tune_info;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The ISA level associated with mips_arch. */
1992-02-06 21:09:50 +01:00
int mips_isa;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The architecture selected by -mipsN, or null if -mipsN wasn't used. */
static const struct mips_cpu_info *mips_isa_option_info;
/* Which ABI to use. */
int mips_abi = MIPS_ABI_DEFAULT;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Which cost information to use. */
const struct mips_rtx_cost_data *mips_cost;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The ambient target flags, excluding MASK_MIPS16. */
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
static int mips_base_target_flags;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* True if MIPS16 is the default mode. */
bool mips_base_mips16;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The ambient values of other global variables. */
static int mips_base_delayed_branch; /* flag_delayed_branch */
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
static int mips_base_schedule_insns; /* flag_schedule_insns */
static int mips_base_reorder_blocks_and_partition; /* flag_reorder... */
static int mips_base_move_loop_invariants; /* flag_move_loop_invariants */
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
static int mips_base_align_loops; /* align_loops */
static int mips_base_align_jumps; /* align_jumps */
static int mips_base_align_functions; /* align_functions */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The -mcode-readable setting. */
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
enum mips_code_readable_setting mips_code_readable = CODE_READABLE_YES;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Index [M][R] is true if register R is allowed to hold a value of mode M. */
bool mips_hard_regno_mode_ok[(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER];
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Index C is true if character C is a valid PRINT_OPERAND punctation
character. */
bool mips_print_operand_punct[256];
1992-02-06 21:09:50 +01:00
static GTY (()) int mips_output_filename_first_time = 1;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
/* mips_split_p[X] is true if symbols of type X can be split by
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_split_symbol. */
bool mips_split_p[NUM_SYMBOL_TYPES];
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* mips_split_hi_p[X] is true if the high parts of symbols of type X
can be split by mips_split_symbol. */
bool mips_split_hi_p[NUM_SYMBOL_TYPES];
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
/* mips_lo_relocs[X] is the relocation to use when a symbol of type X
appears in a LO_SUM. It can be null if such LO_SUMs aren't valid or
if they are matched by a special .md file pattern. */
static const char *mips_lo_relocs[NUM_SYMBOL_TYPES];
/* Likewise for HIGHs. */
static const char *mips_hi_relocs[NUM_SYMBOL_TYPES];
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Index R is the smallest register class that contains register R. */
const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = {
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
LEA_REGS, LEA_REGS, M16_REGS, V1_REG,
M16_REGS, M16_REGS, M16_REGS, M16_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
M16_REGS, M16_REGS, LEA_REGS, LEA_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
T_REG, PIC_FN_ADDR_REG, LEA_REGS, LEA_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
1992-02-06 21:09:50 +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,
MD0_REG, MD1_REG, NO_REGS, ST_REGS,
ST_REGS, ST_REGS, ST_REGS, ST_REGS,
ST_REGS, ST_REGS, ST_REGS, NO_REGS,
NO_REGS, ALL_REGS, ALL_REGS, NO_REGS,
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS,
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS,
DSP_ACC_REGS, DSP_ACC_REGS, DSP_ACC_REGS, DSP_ACC_REGS,
DSP_ACC_REGS, DSP_ACC_REGS, ALL_REGS, ALL_REGS,
ALL_REGS, ALL_REGS, ALL_REGS, ALL_REGS
1992-02-06 21:09:50 +01:00
};
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The value of TARGET_ATTRIBUTE_TABLE. */
const struct attribute_spec mips_attribute_table[] = {
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
{ "long_call", 0, 0, false, true, true, NULL },
{ "far", 0, 0, false, true, true, NULL },
{ "near", 0, 0, false, true, true, NULL },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* We would really like to treat "mips16" and "nomips16" as type
attributes, but GCC doesn't provide the hooks we need to support
the right conversion rules. As declaration attributes, they affect
code generation but don't carry other semantics. */
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
{ "mips16", 0, 0, true, false, false, NULL },
{ "nomips16", 0, 0, true, false, false, NULL },
{ NULL, 0, 0, false, false, false, NULL }
};
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* A table describing all the processors GCC knows about. Names are
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
matched in the order listed. The first mention of an ISA level is
taken as the canonical name for that ISA.
To ease comparison, please keep this table in the same order
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
as GAS's mips_cpu_info_table. Please also make sure that
MIPS_ISA_LEVEL_SPEC and MIPS_ARCH_FLOAT_SPEC handle all -march
options correctly. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
static const struct mips_cpu_info mips_cpu_info_table[] = {
/* Entries for generic ISAs. */
{ "mips1", PROCESSOR_R3000, 1, 0 },
{ "mips2", PROCESSOR_R6000, 2, 0 },
{ "mips3", PROCESSOR_R4000, 3, 0 },
{ "mips4", PROCESSOR_R8000, 4, 0 },
/* Prefer not to use branch-likely instructions for generic MIPS32rX
and MIPS64rX code. The instructions were officially deprecated
in revisions 2 and earlier, but revision 3 is likely to downgrade
that to a recommendation to avoid the instructions in code that
isn't tuned to a specific processor. */
{ "mips32", PROCESSOR_4KC, 32, PTF_AVOID_BRANCHLIKELY },
{ "mips32r2", PROCESSOR_M4K, 33, PTF_AVOID_BRANCHLIKELY },
{ "mips64", PROCESSOR_5KC, 64, PTF_AVOID_BRANCHLIKELY },
/* ??? For now just tune the generic MIPS64r2 for 5KC as well. */
{ "mips64r2", PROCESSOR_5KC, 65, PTF_AVOID_BRANCHLIKELY },
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS I processors. */
{ "r3000", PROCESSOR_R3000, 1, 0 },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ "r2000", PROCESSOR_R3000, 1, 0 },
{ "r3900", PROCESSOR_R3900, 1, 0 },
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS II processors. */
{ "r6000", PROCESSOR_R6000, 2, 0 },
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS III processors. */
{ "r4000", PROCESSOR_R4000, 3, 0 },
{ "vr4100", PROCESSOR_R4100, 3, 0 },
{ "vr4111", PROCESSOR_R4111, 3, 0 },
{ "vr4120", PROCESSOR_R4120, 3, 0 },
{ "vr4130", PROCESSOR_R4130, 3, 0 },
{ "vr4300", PROCESSOR_R4300, 3, 0 },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ "r4400", PROCESSOR_R4000, 3, 0 },
{ "r4600", PROCESSOR_R4600, 3, 0 },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ "orion", PROCESSOR_R4600, 3, 0 },
{ "r4650", PROCESSOR_R4650, 3, 0 },
/* ST Loongson 2E/2F processors. */
{ "loongson2e", PROCESSOR_LOONGSON_2E, 3, PTF_AVOID_BRANCHLIKELY },
{ "loongson2f", PROCESSOR_LOONGSON_2F, 3, PTF_AVOID_BRANCHLIKELY },
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS IV processors. */
{ "r8000", PROCESSOR_R8000, 4, 0 },
{ "vr5000", PROCESSOR_R5000, 4, 0 },
{ "vr5400", PROCESSOR_R5400, 4, 0 },
{ "vr5500", PROCESSOR_R5500, 4, PTF_AVOID_BRANCHLIKELY },
{ "rm7000", PROCESSOR_R7000, 4, 0 },
{ "rm9000", PROCESSOR_R9000, 4, 0 },
config.sub: Import from master repository. 2002-08-15 Eric Christopher <echristo@redhat.com> * config.sub: Import from master repository. * config.guess: Ditto. 2002-08-15 Eric Christopher <echristo@redhat.com> Jeff Knaggs <jknaggs@redhat.com> * config.gcc (mipsisa64sr71k-elf): New target. * config/mips/sr71k.md: New file. * config/mips/mips.md: Use it. (rot*): Add sr71k specifics. * config/mips/t-sr71k: New file. * config/mips/mips.h (sr71k): New cpu. (TARGET_SR71K): Use it. (TUNE_SR71K): Ditto. (GENERATE_BRANCHLIKELY): Ditto. (ISA_HAS_MULHI, ISA_HAS_MULS, ISA_HAS_MSAC, ISA_HAS_MACC, ISA_HAS_ROTR_SIISA_HAS_ROTR_DI): Ditto. * config/mips/mips.c (sr71k): New cpu. (mips_use_dfa_pipeline_interface): Use. 2002-08-15 Eric Christopher <echristo@redhat.com> Richard Sandiford <rsandifo@redhat.com> Aldy Hernandez <aldyh@redhat.com> Graham Stott <grahams@redhat.com> Michael Meissner <meissner@redhat.com> Gavin Romig-Koch <gavin@redhat.com> Ken Raeburn <raeburn@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config.gcc (mips64vr-elf): New target. * config/mips/5400.md: New file. * config/mips/5500.md: Ditto. * config/mips/mips.md: Use them. (frsqrt): New. * config/mips/mips.c (vr4111, vr4121, vr4320, vr5400, vr5500): New cpus. (mips_issue_rate): Use them. (mips_use_dfa_pipeline_interface): New function. Use for 5400 and 5500. (TARGET_SCHEDUSE_DFA_PIPELINE_INTERFACE): Define. Use above. * config/mips/mips.h (vr4111, vr4121, vr4320, vr5400, vr5500): New cpus. (TARGET_MIPSx): Use them. (TUNE_MIPSx): Ditto. (GETNATE_MULT3_SI): Ditto. (ISA_HAS_BRANCHLIKELY): Ditto. (ISA_HAS_CONDMOVE): Ditto. (ISA_HAS_NMADD_NMSUB): Ditto. (ISA_HAS_MULHI): New. Ditto. (ISA_HAS_MULS): Ditto. (ISA_HAS_MSAC): Ditto. (ISA_HAS_MACC): Ditto. (ISA_HAS_ROTR_SI): Ditto. (ISA_HAS_ROTR_DI): Ditto. (RTX_COSTS): Use. From-SVN: r56471
2002-08-20 23:53:28 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS32 processors. */
{ "4kc", PROCESSOR_4KC, 32, 0 },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ "4km", PROCESSOR_4KC, 32, 0 },
{ "4kp", PROCESSOR_4KP, 32, 0 },
{ "4ksc", PROCESSOR_4KC, 32, 0 },
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS32 Release 2 processors. */
{ "m4k", PROCESSOR_M4K, 33, 0 },
{ "4kec", PROCESSOR_4KC, 33, 0 },
{ "4kem", PROCESSOR_4KC, 33, 0 },
{ "4kep", PROCESSOR_4KP, 33, 0 },
{ "4ksd", PROCESSOR_4KC, 33, 0 },
{ "24kc", PROCESSOR_24KC, 33, 0 },
{ "24kf2_1", PROCESSOR_24KF2_1, 33, 0 },
{ "24kf", PROCESSOR_24KF2_1, 33, 0 },
{ "24kf1_1", PROCESSOR_24KF1_1, 33, 0 },
{ "24kfx", PROCESSOR_24KF1_1, 33, 0 },
{ "24kx", PROCESSOR_24KF1_1, 33, 0 },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ "24kec", PROCESSOR_24KC, 33, 0 }, /* 24K with DSP. */
{ "24kef2_1", PROCESSOR_24KF2_1, 33, 0 },
{ "24kef", PROCESSOR_24KF2_1, 33, 0 },
{ "24kef1_1", PROCESSOR_24KF1_1, 33, 0 },
{ "24kefx", PROCESSOR_24KF1_1, 33, 0 },
{ "24kex", PROCESSOR_24KF1_1, 33, 0 },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ "34kc", PROCESSOR_24KC, 33, 0 }, /* 34K with MT/DSP. */
{ "34kf2_1", PROCESSOR_24KF2_1, 33, 0 },
{ "34kf", PROCESSOR_24KF2_1, 33, 0 },
{ "34kf1_1", PROCESSOR_24KF1_1, 33, 0 },
{ "34kfx", PROCESSOR_24KF1_1, 33, 0 },
{ "34kx", PROCESSOR_24KF1_1, 33, 0 },
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ "74kc", PROCESSOR_74KC, 33, 0 }, /* 74K with DSPr2. */
{ "74kf2_1", PROCESSOR_74KF2_1, 33, 0 },
{ "74kf", PROCESSOR_74KF2_1, 33, 0 },
{ "74kf1_1", PROCESSOR_74KF1_1, 33, 0 },
{ "74kfx", PROCESSOR_74KF1_1, 33, 0 },
{ "74kx", PROCESSOR_74KF1_1, 33, 0 },
{ "74kf3_2", PROCESSOR_74KF3_2, 33, 0 },
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS64 processors. */
{ "5kc", PROCESSOR_5KC, 64, 0 },
{ "5kf", PROCESSOR_5KF, 64, 0 },
{ "20kc", PROCESSOR_20KC, 64, PTF_AVOID_BRANCHLIKELY },
{ "sb1", PROCESSOR_SB1, 64, PTF_AVOID_BRANCHLIKELY },
{ "sb1a", PROCESSOR_SB1A, 64, PTF_AVOID_BRANCHLIKELY },
{ "sr71000", PROCESSOR_SR71000, 64, PTF_AVOID_BRANCHLIKELY },
{ "xlr", PROCESSOR_XLR, 64, 0 }
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
};
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Default costs. If these are used for a processor we should look
up the actual costs. */
#define DEFAULT_COSTS COSTS_N_INSNS (6), /* fp_add */ \
COSTS_N_INSNS (7), /* fp_mult_sf */ \
COSTS_N_INSNS (8), /* fp_mult_df */ \
COSTS_N_INSNS (23), /* fp_div_sf */ \
COSTS_N_INSNS (36), /* fp_div_df */ \
COSTS_N_INSNS (10), /* int_mult_si */ \
COSTS_N_INSNS (10), /* int_mult_di */ \
COSTS_N_INSNS (69), /* int_div_si */ \
COSTS_N_INSNS (69), /* int_div_di */ \
2, /* branch_cost */ \
4 /* memory_latency */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Floating-point costs for processors without an FPU. Just assume that
all floating-point libcalls are very expensive. */
#define SOFT_FP_COSTS COSTS_N_INSNS (256), /* fp_add */ \
COSTS_N_INSNS (256), /* fp_mult_sf */ \
COSTS_N_INSNS (256), /* fp_mult_df */ \
COSTS_N_INSNS (256), /* fp_div_sf */ \
COSTS_N_INSNS (256) /* fp_div_df */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Costs to use when optimizing for size. */
static const struct mips_rtx_cost_data mips_rtx_cost_optimize_size = {
COSTS_N_INSNS (1), /* fp_add */
COSTS_N_INSNS (1), /* fp_mult_sf */
COSTS_N_INSNS (1), /* fp_mult_df */
COSTS_N_INSNS (1), /* fp_div_sf */
COSTS_N_INSNS (1), /* fp_div_df */
COSTS_N_INSNS (1), /* int_mult_si */
COSTS_N_INSNS (1), /* int_mult_di */
COSTS_N_INSNS (1), /* int_div_si */
COSTS_N_INSNS (1), /* int_div_di */
2, /* branch_cost */
4 /* memory_latency */
};
/* Costs to use when optimizing for speed, indexed by processor. */
static const struct mips_rtx_cost_data mips_rtx_cost_data[PROCESSOR_MAX] = {
{ /* R3000 */
COSTS_N_INSNS (2), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (5), /* fp_mult_df */
COSTS_N_INSNS (12), /* fp_div_sf */
COSTS_N_INSNS (19), /* fp_div_df */
COSTS_N_INSNS (12), /* int_mult_si */
COSTS_N_INSNS (12), /* int_mult_di */
COSTS_N_INSNS (35), /* int_div_si */
COSTS_N_INSNS (35), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 4KC */
SOFT_FP_COSTS,
COSTS_N_INSNS (6), /* int_mult_si */
COSTS_N_INSNS (6), /* int_mult_di */
COSTS_N_INSNS (36), /* int_div_si */
COSTS_N_INSNS (36), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 4KP */
SOFT_FP_COSTS,
COSTS_N_INSNS (36), /* int_mult_si */
COSTS_N_INSNS (36), /* int_mult_di */
COSTS_N_INSNS (37), /* int_div_si */
COSTS_N_INSNS (37), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 5KC */
SOFT_FP_COSTS,
COSTS_N_INSNS (4), /* int_mult_si */
COSTS_N_INSNS (11), /* int_mult_di */
COSTS_N_INSNS (36), /* int_div_si */
COSTS_N_INSNS (68), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 5KF */
COSTS_N_INSNS (4), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (5), /* fp_mult_df */
COSTS_N_INSNS (17), /* fp_div_sf */
COSTS_N_INSNS (32), /* fp_div_df */
COSTS_N_INSNS (4), /* int_mult_si */
COSTS_N_INSNS (11), /* int_mult_di */
COSTS_N_INSNS (36), /* int_div_si */
COSTS_N_INSNS (68), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 20KC */
COSTS_N_INSNS (4), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (5), /* fp_mult_df */
COSTS_N_INSNS (17), /* fp_div_sf */
COSTS_N_INSNS (32), /* fp_div_df */
COSTS_N_INSNS (4), /* int_mult_si */
COSTS_N_INSNS (7), /* int_mult_di */
COSTS_N_INSNS (42), /* int_div_si */
COSTS_N_INSNS (72), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 24KC */
SOFT_FP_COSTS,
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (41), /* int_div_si */
COSTS_N_INSNS (41), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 24KF2_1 */
COSTS_N_INSNS (8), /* fp_add */
COSTS_N_INSNS (8), /* fp_mult_sf */
COSTS_N_INSNS (10), /* fp_mult_df */
COSTS_N_INSNS (34), /* fp_div_sf */
COSTS_N_INSNS (64), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (41), /* int_div_si */
COSTS_N_INSNS (41), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 24KF1_1 */
COSTS_N_INSNS (4), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (5), /* fp_mult_df */
COSTS_N_INSNS (17), /* fp_div_sf */
COSTS_N_INSNS (32), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (41), /* int_div_si */
COSTS_N_INSNS (41), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 74KC */
SOFT_FP_COSTS,
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (41), /* int_div_si */
COSTS_N_INSNS (41), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 74KF2_1 */
COSTS_N_INSNS (8), /* fp_add */
COSTS_N_INSNS (8), /* fp_mult_sf */
COSTS_N_INSNS (10), /* fp_mult_df */
COSTS_N_INSNS (34), /* fp_div_sf */
COSTS_N_INSNS (64), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (41), /* int_div_si */
COSTS_N_INSNS (41), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 74KF1_1 */
COSTS_N_INSNS (4), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (5), /* fp_mult_df */
COSTS_N_INSNS (17), /* fp_div_sf */
COSTS_N_INSNS (32), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (41), /* int_div_si */
COSTS_N_INSNS (41), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* 74KF3_2 */
COSTS_N_INSNS (6), /* fp_add */
COSTS_N_INSNS (6), /* fp_mult_sf */
COSTS_N_INSNS (7), /* fp_mult_df */
COSTS_N_INSNS (25), /* fp_div_sf */
COSTS_N_INSNS (48), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (41), /* int_div_si */
COSTS_N_INSNS (41), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* Loongson-2E */
DEFAULT_COSTS
},
{ /* Loongson-2F */
DEFAULT_COSTS
},
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{ /* M4k */
DEFAULT_COSTS
},
{ /* R3900 */
COSTS_N_INSNS (2), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (5), /* fp_mult_df */
COSTS_N_INSNS (12), /* fp_div_sf */
COSTS_N_INSNS (19), /* fp_div_df */
COSTS_N_INSNS (2), /* int_mult_si */
COSTS_N_INSNS (2), /* int_mult_di */
COSTS_N_INSNS (35), /* int_div_si */
COSTS_N_INSNS (35), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* R6000 */
COSTS_N_INSNS (3), /* fp_add */
COSTS_N_INSNS (5), /* fp_mult_sf */
COSTS_N_INSNS (6), /* fp_mult_df */
COSTS_N_INSNS (15), /* fp_div_sf */
COSTS_N_INSNS (16), /* fp_div_df */
COSTS_N_INSNS (17), /* int_mult_si */
COSTS_N_INSNS (17), /* int_mult_di */
COSTS_N_INSNS (38), /* int_div_si */
COSTS_N_INSNS (38), /* int_div_di */
2, /* branch_cost */
6 /* memory_latency */
},
{ /* R4000 */
COSTS_N_INSNS (6), /* fp_add */
COSTS_N_INSNS (7), /* fp_mult_sf */
COSTS_N_INSNS (8), /* fp_mult_df */
COSTS_N_INSNS (23), /* fp_div_sf */
COSTS_N_INSNS (36), /* fp_div_df */
COSTS_N_INSNS (10), /* int_mult_si */
COSTS_N_INSNS (10), /* int_mult_di */
COSTS_N_INSNS (69), /* int_div_si */
COSTS_N_INSNS (69), /* int_div_di */
2, /* branch_cost */
6 /* memory_latency */
},
{ /* R4100 */
DEFAULT_COSTS
},
{ /* R4111 */
DEFAULT_COSTS
},
{ /* R4120 */
DEFAULT_COSTS
},
{ /* R4130 */
/* The only costs that appear to be updated here are
integer multiplication. */
SOFT_FP_COSTS,
COSTS_N_INSNS (4), /* int_mult_si */
COSTS_N_INSNS (6), /* int_mult_di */
COSTS_N_INSNS (69), /* int_div_si */
COSTS_N_INSNS (69), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* R4300 */
DEFAULT_COSTS
},
{ /* R4600 */
DEFAULT_COSTS
},
{ /* R4650 */
DEFAULT_COSTS
},
{ /* R5000 */
COSTS_N_INSNS (6), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (5), /* fp_mult_df */
COSTS_N_INSNS (23), /* fp_div_sf */
COSTS_N_INSNS (36), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (5), /* int_mult_di */
COSTS_N_INSNS (36), /* int_div_si */
COSTS_N_INSNS (36), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* R5400 */
COSTS_N_INSNS (6), /* fp_add */
COSTS_N_INSNS (5), /* fp_mult_sf */
COSTS_N_INSNS (6), /* fp_mult_df */
COSTS_N_INSNS (30), /* fp_div_sf */
COSTS_N_INSNS (59), /* fp_div_df */
COSTS_N_INSNS (3), /* int_mult_si */
COSTS_N_INSNS (4), /* int_mult_di */
COSTS_N_INSNS (42), /* int_div_si */
COSTS_N_INSNS (74), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* R5500 */
COSTS_N_INSNS (6), /* fp_add */
COSTS_N_INSNS (5), /* fp_mult_sf */
COSTS_N_INSNS (6), /* fp_mult_df */
COSTS_N_INSNS (30), /* fp_div_sf */
COSTS_N_INSNS (59), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (9), /* int_mult_di */
COSTS_N_INSNS (42), /* int_div_si */
COSTS_N_INSNS (74), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* R7000 */
/* The only costs that are changed here are
integer multiplication. */
COSTS_N_INSNS (6), /* fp_add */
COSTS_N_INSNS (7), /* fp_mult_sf */
COSTS_N_INSNS (8), /* fp_mult_df */
COSTS_N_INSNS (23), /* fp_div_sf */
COSTS_N_INSNS (36), /* fp_div_df */
COSTS_N_INSNS (5), /* int_mult_si */
COSTS_N_INSNS (9), /* int_mult_di */
COSTS_N_INSNS (69), /* int_div_si */
COSTS_N_INSNS (69), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* R8000 */
DEFAULT_COSTS
},
{ /* R9000 */
/* The only costs that are changed here are
integer multiplication. */
COSTS_N_INSNS (6), /* fp_add */
COSTS_N_INSNS (7), /* fp_mult_sf */
COSTS_N_INSNS (8), /* fp_mult_df */
COSTS_N_INSNS (23), /* fp_div_sf */
COSTS_N_INSNS (36), /* fp_div_df */
COSTS_N_INSNS (3), /* int_mult_si */
COSTS_N_INSNS (8), /* int_mult_di */
COSTS_N_INSNS (69), /* int_div_si */
COSTS_N_INSNS (69), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* SB1 */
/* These costs are the same as the SB-1A below. */
COSTS_N_INSNS (4), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (4), /* fp_mult_df */
COSTS_N_INSNS (24), /* fp_div_sf */
COSTS_N_INSNS (32), /* fp_div_df */
COSTS_N_INSNS (3), /* int_mult_si */
COSTS_N_INSNS (4), /* int_mult_di */
COSTS_N_INSNS (36), /* int_div_si */
COSTS_N_INSNS (68), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* SB1-A */
/* These costs are the same as the SB-1 above. */
COSTS_N_INSNS (4), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
COSTS_N_INSNS (4), /* fp_mult_df */
COSTS_N_INSNS (24), /* fp_div_sf */
COSTS_N_INSNS (32), /* fp_div_df */
COSTS_N_INSNS (3), /* int_mult_si */
COSTS_N_INSNS (4), /* int_mult_di */
COSTS_N_INSNS (36), /* int_div_si */
COSTS_N_INSNS (68), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
},
{ /* SR71000 */
DEFAULT_COSTS
},
{ /* XLR */
/* Need to replace first five with the costs of calling the appropriate
libgcc routine. */
COSTS_N_INSNS (256), /* fp_add */
COSTS_N_INSNS (256), /* fp_mult_sf */
COSTS_N_INSNS (256), /* fp_mult_df */
COSTS_N_INSNS (256), /* fp_div_sf */
COSTS_N_INSNS (256), /* fp_div_df */
COSTS_N_INSNS (8), /* int_mult_si */
COSTS_N_INSNS (8), /* int_mult_di */
COSTS_N_INSNS (72), /* int_div_si */
COSTS_N_INSNS (72), /* int_div_di */
1, /* branch_cost */
4 /* memory_latency */
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
};
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* This hash table keeps track of implicit "mips16" and "nomips16" attributes
for -mflip_mips16. It maps decl names onto a boolean mode setting. */
struct mflip_mips16_entry GTY (()) {
const char *name;
bool mips16_p;
};
static GTY ((param_is (struct mflip_mips16_entry))) htab_t mflip_mips16_htab;
/* Hash table callbacks for mflip_mips16_htab. */
static hashval_t
mflip_mips16_htab_hash (const void *entry)
{
return htab_hash_string (((const struct mflip_mips16_entry *) entry)->name);
}
re PR rtl-optimization/24762 ([killloop-branch] code motion of non-invariant expressions with hard registers.) 2006-01-27 Daniel Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> PR rtl-optimization/24762 * doc/tm.texi: Added TARGET_EXTRA_LIVE_ON_ENTRY. * targhooks.c (hook_void_bitmap): New hook prototype. * targhoohs.h (hook_void_bitmap): Ditto. * bitmap.h (bitmap_head_def): Moved to coretypes.h. * coretypes.h (bitmap_head_def): Moved from bitmap.h. * target.h (live_on_entry): New function pointer. * df-scan.c (df_all_hard_regs): Removed. (df_scan_dump, df_hard_reg_init): Removed df_all_hard_regs. (df_scan_free_internal): Added df->entry_block_defs. (df_scan_alloc): Ditto. (df_scan_dump): Ditto. (df_uses_record): Plumbed flag field properly thru calls. Record EH_RETURN_DATA_REGNO in eh blocks unconditionally. This part fixes PR24762. (df_bb_refs_record): Added code to make the frame and arg pointers live in EH blocks. (df_refs_record): Added call to df_record_entry_block_defs. (df_record_entry_block_defs): New function. * df-core.c: Added comments to describe new artifical defs. * df.h (DF_REF_DIES_AFTER_THIS_USE): New flag in enum df_ref_flags. (entry_block_defs): New field in struct df. (df_all_hard_regs): Deleted. * target-def.h: Added TARGET_EXTRA_LIVE_ON_ENTRY. * df-problems.c (df_ru_bb_local_compute_process_def): Added code to handle artifical defs in the entry to a function. (df_ru_bb_local_compute): Ditto. (df_rd_bb_local_compute_process_def): Ditto. (df_rd_bb_local_compute): Ditto. (df_lr_bb_local_compute): Ditto. (df_ur_bb_local_compute): Ditto. (df_urec_bb_local_compute): Ditto. (df_chain_create_bb): Ditto. (df_ur_local_finalize): Removed entry. (df_urec_init): Ditto. (df_urec_local_finalize): Ditto. (df_ri_bb_compute): Added detection of last use of pseudos. * Makefile.in (df-scan.o): Updated dependencies. * config/mips/mips-protos.h (mips_set_live_on_entry): Added. * config/mips/mips.c (mips_set_live_on_entry): Added. * config/mips/mips.c (TARGET_EXTRA_LIVE_ON_ENTRY): Added value for target hook. * dce.c (marked_insn_p): Added code to handle artifical defs. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r110312
2006-01-27 23:23:32 +01:00
static int
mflip_mips16_htab_eq (const void *entry, const void *name)
{
return strcmp (((const struct mflip_mips16_entry *) entry)->name,
(const char *) name) == 0;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* True if -mflip-mips16 should next add an attribute for the default MIPS16
mode, false if it should next add an attribute for the opposite mode. */
static GTY(()) bool mips16_flipper;
/* DECL is a function that needs a default "mips16" or "nomips16" attribute
for -mflip-mips16. Return true if it should use "mips16" and false if
it should use "nomips16". */
static bool
mflip_mips16_use_mips16_p (tree decl)
{
struct mflip_mips16_entry *entry;
const char *name;
hashval_t hash;
void **slot;
/* Use the opposite of the command-line setting for anonymous decls. */
if (!DECL_NAME (decl))
return !mips_base_mips16;
if (!mflip_mips16_htab)
mflip_mips16_htab = htab_create_ggc (37, mflip_mips16_htab_hash,
mflip_mips16_htab_eq, NULL);
name = IDENTIFIER_POINTER (DECL_NAME (decl));
hash = htab_hash_string (name);
slot = htab_find_slot_with_hash (mflip_mips16_htab, name, hash, INSERT);
entry = (struct mflip_mips16_entry *) *slot;
if (!entry)
{
mips16_flipper = !mips16_flipper;
entry = GGC_NEW (struct mflip_mips16_entry);
entry->name = name;
entry->mips16_p = mips16_flipper ? !mips_base_mips16 : mips_base_mips16;
*slot = entry;
}
return entry->mips16_p;
}
/* Predicates to test for presence of "near" and "far"/"long_call"
attributes on the given TYPE. */
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
mips_near_type_p (const_tree type)
{
return lookup_attribute ("near", TYPE_ATTRIBUTES (type)) != NULL;
}
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
mips_far_type_p (const_tree type)
{
return (lookup_attribute ("long_call", TYPE_ATTRIBUTES (type)) != NULL
|| lookup_attribute ("far", TYPE_ATTRIBUTES (type)) != NULL);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Similar predicates for "mips16"/"nomips16" function attributes. */
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
static bool
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
mips_mips16_decl_p (const_tree decl)
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
{
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
return lookup_attribute ("mips16", DECL_ATTRIBUTES (decl)) != NULL;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
}
static bool
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
mips_nomips16_decl_p (const_tree decl)
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
{
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
return lookup_attribute ("nomips16", DECL_ATTRIBUTES (decl)) != NULL;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
}
/* Return true if function DECL is a MIPS16 function. Return the ambient
setting if DECL is null. */
static bool
mips_use_mips16_mode_p (tree decl)
{
if (decl)
{
/* Nested functions must use the same frame pointer as their
parent and must therefore use the same ISA mode. */
tree parent = decl_function_context (decl);
if (parent)
decl = parent;
if (mips_mips16_decl_p (decl))
return true;
if (mips_nomips16_decl_p (decl))
return false;
}
return mips_base_mips16;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_COMP_TYPE_ATTRIBUTES. */
static int
mips_comp_type_attributes (const_tree type1, const_tree type2)
{
/* Disallow mixed near/far attributes. */
if (mips_far_type_p (type1) && mips_near_type_p (type2))
return 0;
if (mips_near_type_p (type1) && mips_far_type_p (type2))
return 0;
return 1;
}
/* Implement TARGET_INSERT_ATTRIBUTES. */
static void
mips_insert_attributes (tree decl, tree *attributes)
{
const char *name;
bool mips16_p, nomips16_p;
/* Check for "mips16" and "nomips16" attributes. */
mips16_p = lookup_attribute ("mips16", *attributes) != NULL;
nomips16_p = lookup_attribute ("nomips16", *attributes) != NULL;
if (TREE_CODE (decl) != FUNCTION_DECL)
{
if (mips16_p)
error ("%qs attribute only applies to functions", "mips16");
if (nomips16_p)
error ("%qs attribute only applies to functions", "nomips16");
}
else
{
mips16_p |= mips_mips16_decl_p (decl);
nomips16_p |= mips_nomips16_decl_p (decl);
if (mips16_p || nomips16_p)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* DECL cannot be simultaneously "mips16" and "nomips16". */
if (mips16_p && nomips16_p)
error ("%qs cannot have both %<mips16%> and "
"%<nomips16%> attributes",
IDENTIFIER_POINTER (DECL_NAME (decl)));
}
else if (TARGET_FLIP_MIPS16 && !DECL_ARTIFICIAL (decl))
{
/* Implement -mflip-mips16. If DECL has neither a "nomips16" nor a
"mips16" attribute, arbitrarily pick one. We must pick the same
setting for duplicate declarations of a function. */
name = mflip_mips16_use_mips16_p (decl) ? "mips16" : "nomips16";
*attributes = tree_cons (get_identifier (name), NULL, *attributes);
}
}
}
/* Implement TARGET_MERGE_DECL_ATTRIBUTES. */
static tree
mips_merge_decl_attributes (tree olddecl, tree newdecl)
{
/* The decls' "mips16" and "nomips16" attributes must match exactly. */
if (mips_mips16_decl_p (olddecl) != mips_mips16_decl_p (newdecl))
error ("%qs redeclared with conflicting %qs attributes",
IDENTIFIER_POINTER (DECL_NAME (newdecl)), "mips16");
if (mips_nomips16_decl_p (olddecl) != mips_nomips16_decl_p (newdecl))
error ("%qs redeclared with conflicting %qs attributes",
IDENTIFIER_POINTER (DECL_NAME (newdecl)), "nomips16");
return merge_attributes (DECL_ATTRIBUTES (olddecl),
DECL_ATTRIBUTES (newdecl));
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* If X is a PLUS of a CONST_INT, return the two terms in *BASE_PTR
and *OFFSET_PTR. Return X in *BASE_PTR and 0 in *OFFSET_PTR otherwise. */
static void
mips_split_plus (rtx x, rtx *base_ptr, HOST_WIDE_INT *offset_ptr)
{
if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT)
{
*base_ptr = XEXP (x, 0);
*offset_ptr = INTVAL (XEXP (x, 1));
}
else
{
*base_ptr = x;
*offset_ptr = 0;
}
}
static unsigned int mips_build_integer (struct mips_integer_op *,
unsigned HOST_WIDE_INT);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* A subroutine of mips_build_integer, with the same interface.
Assume that the final action in the sequence should be a left shift. */
static unsigned int
mips_build_shift (struct mips_integer_op *codes, HOST_WIDE_INT value)
{
unsigned int i, shift;
/* Shift VALUE right until its lowest bit is set. Shift arithmetically
since signed numbers are easier to load than unsigned ones. */
shift = 0;
while ((value & 1) == 0)
value /= 2, shift++;
i = mips_build_integer (codes, value);
codes[i].code = ASHIFT;
codes[i].value = shift;
return i + 1;
}
/* As for mips_build_shift, but assume that the final action will be
an IOR or PLUS operation. */
static unsigned int
mips_build_lower (struct mips_integer_op *codes, unsigned HOST_WIDE_INT value)
{
unsigned HOST_WIDE_INT high;
unsigned int i;
high = value & ~(unsigned HOST_WIDE_INT) 0xffff;
if (!LUI_OPERAND (high) && (value & 0x18000) == 0x18000)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The constant is too complex to load with a simple LUI/ORI pair,
so we want to give the recursive call as many trailing zeros as
possible. In this case, we know bit 16 is set and that the
low 16 bits form a negative number. If we subtract that number
from VALUE, we will clear at least the lowest 17 bits, maybe more. */
i = mips_build_integer (codes, CONST_HIGH_PART (value));
codes[i].code = PLUS;
codes[i].value = CONST_LOW_PART (value);
}
else
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Either this is a simple LUI/ORI pair, or clearing the lowest 16
bits gives a value with at least 17 trailing zeros. */
i = mips_build_integer (codes, high);
codes[i].code = IOR;
codes[i].value = value & 0xffff;
}
return i + 1;
}
/* Fill CODES with a sequence of rtl operations to load VALUE.
Return the number of operations needed. */
static unsigned int
mips_build_integer (struct mips_integer_op *codes,
unsigned HOST_WIDE_INT value)
{
if (SMALL_OPERAND (value)
|| SMALL_OPERAND_UNSIGNED (value)
|| LUI_OPERAND (value))
{
/* The value can be loaded with a single instruction. */
codes[0].code = UNKNOWN;
codes[0].value = value;
return 1;
}
else if ((value & 1) != 0 || LUI_OPERAND (CONST_HIGH_PART (value)))
{
/* Either the constant is a simple LUI/ORI combination or its
lowest bit is set. We don't want to shift in this case. */
return mips_build_lower (codes, value);
}
else if ((value & 0xffff) == 0)
{
/* The constant will need at least three actions. The lowest
16 bits are clear, so the final action will be a shift. */
return mips_build_shift (codes, value);
}
else
{
/* The final action could be a shift, add or inclusive OR.
Rather than use a complex condition to select the best
approach, try both mips_build_shift and mips_build_lower
and pick the one that gives the shortest sequence.
Note that this case is only used once per constant. */
struct mips_integer_op alt_codes[MIPS_MAX_INTEGER_OPS];
unsigned int cost, alt_cost;
cost = mips_build_shift (codes, value);
alt_cost = mips_build_lower (alt_codes, value);
if (alt_cost < cost)
{
memcpy (codes, alt_codes, alt_cost * sizeof (codes[0]));
cost = alt_cost;
}
return cost;
}
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Return true if symbols of type TYPE require a GOT access. */
static bool
mips_got_symbol_type_p (enum mips_symbol_type type)
{
switch (type)
{
case SYMBOL_GOT_PAGE_OFST:
case SYMBOL_GOT_DISP:
return true;
default:
return false;
}
}
/* Return true if X is a thread-local symbol. */
static bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_tls_symbol_p (rtx x)
{
return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0;
}
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
/* Return true if SYMBOL_REF X is associated with a global symbol
(in the STB_GLOBAL sense). */
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
mips_global_symbol_p (const_rtx x)
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
const_tree decl = SYMBOL_REF_DECL (x);
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
if (!decl)
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
return !SYMBOL_REF_LOCAL_P (x) || SYMBOL_REF_EXTERNAL_P (x);
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
/* Weakref symbols are not TREE_PUBLIC, but their targets are global
or weak symbols. Relocations in the object file will be against
the target symbol, so it's that symbol's binding that matters here. */
return DECL_P (decl) && (TREE_PUBLIC (decl) || DECL_WEAK (decl));
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Return true if function X is a libgcc MIPS16 stub function. */
static bool
mips16_stub_function_p (const_rtx x)
{
return (GET_CODE (x) == SYMBOL_REF
&& strncmp (XSTR (x, 0), "__mips16_", 9) == 0);
}
/* Return true if function X is a locally-defined and locally-binding
MIPS16 function. */
static bool
mips16_local_function_p (const_rtx x)
{
return (GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_LOCAL_P (x)
&& !SYMBOL_REF_EXTERNAL_P (x)
&& mips_use_mips16_mode_p (SYMBOL_REF_DECL (x)));
}
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
/* Return true if SYMBOL_REF X binds locally. */
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
mips_symbol_binds_local_p (const_rtx x)
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
{
return (SYMBOL_REF_DECL (x)
? targetm.binds_local_p (SYMBOL_REF_DECL (x))
: SYMBOL_REF_LOCAL_P (x));
}
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
/* Return true if rtx constants of mode MODE should be put into a small
data section. */
static bool
mips_rtx_constant_in_small_data_p (enum machine_mode mode)
{
return (!TARGET_EMBEDDED_DATA
&& TARGET_LOCAL_SDATA
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& GET_MODE_SIZE (mode) <= mips_small_data_threshold);
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
}
/* Return true if X should not be moved directly into register $25.
We need this because many versions of GAS will treat "la $25,foo" as
part of a call sequence and so allow a global "foo" to be lazily bound. */
bool
mips_dangerous_for_la25_p (rtx x)
{
return (!TARGET_EXPLICIT_RELOCS
&& TARGET_USE_GOT
&& GET_CODE (x) == SYMBOL_REF
&& mips_global_symbol_p (x));
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Return true if calls to X might need $25 to be valid on entry. */
bool
mips_use_pic_fn_addr_reg_p (const_rtx x)
{
if (!TARGET_USE_PIC_FN_ADDR_REG)
return false;
/* MIPS16 stub functions are guaranteed not to use $25. */
if (mips16_stub_function_p (x))
return false;
/* When TARGET_ABSOLUTE_ABICALLS is true, locally-defined functions
use absolute accesses to set up the global pointer. */
if (TARGET_ABSOLUTE_ABICALLS
&& GET_CODE (x) == SYMBOL_REF
&& mips_symbol_binds_local_p (x)
&& !SYMBOL_REF_EXTERNAL_P (x))
return false;
return true;
}
/* Return the method that should be used to access SYMBOL_REF or
LABEL_REF X in context CONTEXT. */
static enum mips_symbol_type
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
mips_classify_symbol (const_rtx x, enum mips_symbol_context context)
1992-02-06 21:09:50 +01:00
{
if (TARGET_RTP_PIC)
return SYMBOL_GOT_DISP;
if (GET_CODE (x) == LABEL_REF)
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
{
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
/* LABEL_REFs are used for jump tables as well as text labels.
Only return SYMBOL_PC_RELATIVE if we know the label is in
the text section. */
if (TARGET_MIPS16_SHORT_JUMP_TABLES)
return SYMBOL_PC_RELATIVE;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS)
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
return SYMBOL_GOT_PAGE_OFST;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return SYMBOL_ABSOLUTE;
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
}
1992-02-06 21:09:50 +01:00
gcc_assert (GET_CODE (x) == SYMBOL_REF);
if (SYMBOL_REF_TLS_MODEL (x))
return SYMBOL_TLS;
if (CONSTANT_POOL_ADDRESS_P (x))
{
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
if (TARGET_MIPS16_TEXT_LOADS)
return SYMBOL_PC_RELATIVE;
if (TARGET_MIPS16_PCREL_LOADS && context == SYMBOL_CONTEXT_MEM)
return SYMBOL_PC_RELATIVE;
1992-02-06 21:09:50 +01:00
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
if (mips_rtx_constant_in_small_data_p (get_pool_mode (x)))
return SYMBOL_GP_RELATIVE;
}
/* Do not use small-data accesses for weak symbols; they may end up
being zero. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TARGET_GPOPT && SYMBOL_REF_SMALL_P (x) && !SYMBOL_REF_WEAK (x))
return SYMBOL_GP_RELATIVE;
elf64.h (TARGET_ASM_UNIQUE_SECTION): Delete. * config/mips/elf64.h (TARGET_ASM_UNIQUE_SECTION): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SECTION_FUNCTION_TEMPLATE): Delete. * config/mips/elf.h: As for elf64.h. (ASM_OUTPUT_ALIGNED_BSS): Use named_section rather than sbss_section. * config/mips/linux.h: As for elf.h * config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete. * config/mips/iris6.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Remove sdata_section. Remove the handling of in_sdata from current_section_name and current_section_flags. * config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete. * config/mips/mips.h (sdata_section, sbss_section): Remove prototypes. (MASK_GP_OPT, TARGET_GP_OPT): Delete. (MASK_NO_FUSED_MADD): Use MASK_GP_OPT's old value. (TARGET_SWITCHES): Neuter gpOPT, gpopt, no-gpOPT and no-gpopt. (SMALL_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove. * config/mips/mips.c (TARGET_IN_SMALL_DATA_P): Override. (TARGET_SECTION_TYPE_FLAGS): Override if TARGET_IRIX6. (mips_classify_symbol): Use SYMBOL_REF_SMALL_P. (override_options): Remove setting of MASK_GPOPT. (mips_output_external): Use mips_in_small_data_p to check whether a symbol needs an .extern directive. Don't emit such directives for TARGET_EXPLICIT_RELOCS. (mips_declare_object): Update accordingly. (mips_select_rtx_section): Call named_section rather than SMALL_DATA_SECTION. (mips_select_section): Use default_elf_section_section for everything except .text string constants. (mips_in_small_data_p): New function. (mips_encode_section_info): Remove small data handling. (mips_unique_section): Delete. (iris6_section_type_flags): New function. * doc/tm.texi: Remove documentation of -mgpopt and -mhalf-pic. From-SVN: r69090
2003-07-08 19:36:01 +02:00
/* Don't use GOT accesses for locally-binding symbols when -mno-shared
is in effect. */
if (TARGET_ABICALLS
&& !(TARGET_ABSOLUTE_ABICALLS && mips_symbol_binds_local_p (x)))
{
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
/* There are three cases to consider:
- o32 PIC (either with or without explicit relocs)
- n32/n64 PIC without explicit relocs
- n32/n64 PIC with explicit relocs
In the first case, both local and global accesses will use an
R_MIPS_GOT16 relocation. We must correctly predict which of
the two semantics (local or global) the assembler and linker
will apply. The choice depends on the symbol's binding rather
than its visibility.
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
In the second case, the assembler will not use R_MIPS_GOT16
relocations, but it chooses between local and global accesses
in the same way as for o32 PIC.
In the third case we have more freedom since both forms of
access will work for any kind of symbol. However, there seems
little point in doing things differently. */
if (mips_global_symbol_p (x))
return SYMBOL_GOT_DISP;
return SYMBOL_GOT_PAGE_OFST;
}
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
if (TARGET_MIPS16_PCREL_LOADS && context != SYMBOL_CONTEXT_CALL)
return SYMBOL_FORCE_TO_MEM;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return SYMBOL_ABSOLUTE;
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Classify the base of symbolic expression X, given that X appears in
context CONTEXT. */
static enum mips_symbol_type
mips_classify_symbolic_expression (rtx x, enum mips_symbol_context context)
{
rtx offset;
split_const (x, &x, &offset);
if (UNSPEC_ADDRESS_P (x))
return UNSPEC_ADDRESS_TYPE (x);
return mips_classify_symbol (x, context);
}
/* Return true if OFFSET is within the range [0, ALIGN), where ALIGN
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
is the alignment in bytes of SYMBOL_REF X. */
static bool
mips_offset_within_alignment_p (rtx x, HOST_WIDE_INT offset)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
HOST_WIDE_INT align;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
align = SYMBOL_REF_DECL (x) ? DECL_ALIGN_UNIT (SYMBOL_REF_DECL (x)) : 1;
return IN_RANGE (offset, 0, align - 1);
}
/* Return true if X is a symbolic constant that can be used in context
CONTEXT. If it is, store the type of the symbol in *SYMBOL_TYPE. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
* config/mips/mips-protos.h (mips_symbolic_constant_p) (mips_atomic_symbolic_constant_p, mips_stack_address_p) (mips_small_data_pattern_p): Declare. * config/mips/mips.h (CONST_GP_P): Moved from mips.c. (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Delete. * config/mips/mips.c (mips_symbolic_constant_p): Make global. (mips_atomic_symbolic_constant_p, mips_stack_address_p): New functions. (uns_arith_operand, const_arith_operand, arith_operand, sle_operand) (sleu_operand, small_int, reg_or_0_operand, const_float_1_operand) (reg_or_const_float_1_operand, hilo_operand, extend_operator) (macc_msac_operand, equality_op, cmp_op, trap_cmp_op) (pc_or_label_operand, call_insn_operand, move_operand) (consttable_operand, symbolic_operand, general_symbolic_operand) (global_got_operand, local_got_operand, stack_operand) (fp_register_operand, lo_operand, fcc_register_operand): Delete. (mips_small_data_pattern_1): Renamed from small_data_pattern_1. (mips_small_data_pattern_p): Replace previous small_data_pattern predicate. Turn into a bool () (rtx) function. * config/mips/predicates.md: New file. * config/mips/mips.md: Include it. Use the target-independent comparison_operator instead of cmp_op. Rename trap_cmp_op to trap_comparison_operator and equality_op to equality_operator. Replace uses of small_int with the equivalent const_arith_operand. Rename reg_or_const_float_1_operand to reg_or_1_operand. Rename const_float_1_operand to const_1_operand. Rename fcc_register_operand to fcc_reload_operand. * config/mips/sb1.md: Rename fp_register_operand to fpr_operand. From-SVN: r86006
2004-08-14 22:55:56 +02:00
bool
mips_symbolic_constant_p (rtx x, enum mips_symbol_context context,
enum mips_symbol_type *symbol_type)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
{
rtx offset;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
split_const (x, &x, &offset);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (UNSPEC_ADDRESS_P (x))
{
*symbol_type = UNSPEC_ADDRESS_TYPE (x);
x = UNSPEC_ADDRESS (x);
}
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
{
*symbol_type = mips_classify_symbol (x, context);
if (*symbol_type == SYMBOL_TLS)
return false;
}
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
else
return false;
if (offset == const0_rtx)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return true;
/* Check whether a nonzero offset is valid for the underlying
relocations. */
switch (*symbol_type)
{
case SYMBOL_ABSOLUTE:
case SYMBOL_FORCE_TO_MEM:
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
case SYMBOL_32_HIGH:
case SYMBOL_64_HIGH:
case SYMBOL_64_MID:
case SYMBOL_64_LOW:
/* If the target has 64-bit pointers and the object file only
supports 32-bit symbols, the values of those symbols will be
sign-extended. In this case we can't allow an arbitrary offset
in case the 32-bit value X + OFFSET has a different sign from X. */
if (Pmode == DImode && !ABI_HAS_64BIT_SYMBOLS)
return offset_within_block_p (x, INTVAL (offset));
/* In other cases the relocations can handle any offset. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return true;
case SYMBOL_PC_RELATIVE:
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
/* Allow constant pool references to be converted to LABEL+CONSTANT.
In this case, we no longer have access to the underlying constant,
but the original symbol-based access was known to be valid. */
if (GET_CODE (x) == LABEL_REF)
return true;
/* Fall through. */
case SYMBOL_GP_RELATIVE:
/* Make sure that the offset refers to something within the
same object block. This should guarantee that the final
PC- or GP-relative offset is within the 16-bit limit. */
return offset_within_block_p (x, INTVAL (offset));
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
case SYMBOL_GOT_PAGE_OFST:
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case SYMBOL_GOTOFF_PAGE:
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
/* If the symbol is global, the GOT entry will contain the symbol's
address, and we will apply a 16-bit offset after loading it.
If the symbol is local, the linker should provide enough local
GOT entries for a 16-bit offset, but larger offsets may lead
to GOT overflow. */
return SMALL_INT (offset);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case SYMBOL_TPREL:
case SYMBOL_DTPREL:
/* There is no carry between the HI and LO REL relocations, so the
offset is only valid if we know it won't lead to such a carry. */
return mips_offset_within_alignment_p (x, INTVAL (offset));
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
case SYMBOL_GOT_DISP:
case SYMBOL_GOTOFF_DISP:
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case SYMBOL_GOTOFF_CALL:
case SYMBOL_GOTOFF_LOADGP:
case SYMBOL_TLSGD:
case SYMBOL_TLSLDM:
case SYMBOL_GOTTPREL:
case SYMBOL_TLS:
case SYMBOL_HALF:
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return false;
}
gcc_unreachable ();
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
}
/* Like mips_symbol_insns, but treat extended MIPS16 instructions as a
single instruction. We rely on the fact that, in the worst case,
all instructions involved in a MIPS16 address calculation are usually
extended ones. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
static int
mips_symbol_insns_1 (enum mips_symbol_type type, enum machine_mode mode)
1992-02-06 21:09:50 +01:00
{
switch (type)
{
case SYMBOL_ABSOLUTE:
/* When using 64-bit symbols, we need 5 preparatory instructions,
such as:
lui $at,%highest(symbol)
daddiu $at,$at,%higher(symbol)
dsll $at,$at,16
daddiu $at,$at,%hi(symbol)
dsll $at,$at,16
The final address is then $at + %lo(symbol). With 32-bit
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
symbols we just need a preparatory LUI for normal mode and
a preparatory LI and SLL for MIPS16. */
return ABI_HAS_64BIT_SYMBOLS ? 6 : TARGET_MIPS16 ? 3 : 2;
case SYMBOL_GP_RELATIVE:
/* Treat GP-relative accesses as taking a single instruction on
MIPS16 too; the copy of $gp can often be shared. */
return 1;
case SYMBOL_PC_RELATIVE:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* PC-relative constants can be only be used with ADDIUPC,
DADDIUPC, LWPC and LDPC. */
if (mode == MAX_MACHINE_MODE
|| GET_MODE_SIZE (mode) == 4
|| GET_MODE_SIZE (mode) == 8)
return 1;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The constant must be loaded using ADDIUPC or DADDIUPC first. */
return 0;
case SYMBOL_FORCE_TO_MEM:
/* LEAs will be converted into constant-pool references by
mips_reorg. */
if (mode == MAX_MACHINE_MODE)
return 1;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The constant must be loaded and then dereferenced. */
return 0;
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
case SYMBOL_GOT_DISP:
/* The constant will have to be loaded from the GOT before it
is used in an address. */
if (mode != MAX_MACHINE_MODE)
return 0;
/* Fall through. */
case SYMBOL_GOT_PAGE_OFST:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Unless -funit-at-a-time is in effect, we can't be sure whether the
local/global classification is accurate. The worst cases are:
(1) For local symbols when generating o32 or o64 code. The assembler
will use:
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
lw $at,%got(symbol)
nop
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
...and the final address will be $at + %lo(symbol).
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
(2) For global symbols when -mxgot. The assembler will use:
lui $at,%got_hi(symbol)
(d)addu $at,$at,$gp
...and the final address will be $at + %got_lo(symbol). */
return 3;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case SYMBOL_GOTOFF_PAGE:
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
case SYMBOL_GOTOFF_DISP:
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case SYMBOL_GOTOFF_CALL:
case SYMBOL_GOTOFF_LOADGP:
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
case SYMBOL_32_HIGH:
case SYMBOL_64_HIGH:
case SYMBOL_64_MID:
case SYMBOL_64_LOW:
case SYMBOL_TLSGD:
case SYMBOL_TLSLDM:
case SYMBOL_DTPREL:
case SYMBOL_GOTTPREL:
case SYMBOL_TPREL:
case SYMBOL_HALF:
/* A 16-bit constant formed by a single relocation, or a 32-bit
constant formed from a high 16-bit relocation and a low 16-bit
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
relocation. Use mips_split_p to determine which. 32-bit
constants need an "lui; addiu" sequence for normal mode and
an "li; sll; addiu" sequence for MIPS16 mode. */
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
return !mips_split_p[type] ? 1 : TARGET_MIPS16 ? 3 : 2;
case SYMBOL_TLS:
/* We don't treat a bare TLS symbol as a constant. */
return 0;
}
gcc_unreachable ();
}
/* If MODE is MAX_MACHINE_MODE, return the number of instructions needed
to load symbols of type TYPE into a register. Return 0 if the given
type of symbol cannot be used as an immediate operand.
Otherwise, return the number of instructions needed to load or store
values of mode MODE to or from addresses of type TYPE. Return 0 if
the given type of symbol is not valid in addresses.
In both cases, treat extended MIPS16 instructions as two instructions. */
static int
mips_symbol_insns (enum mips_symbol_type type, enum machine_mode mode)
{
return mips_symbol_insns_1 (type, mode) * (TARGET_MIPS16 ? 2 : 1);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* A for_each_rtx callback. Stop the search if *X references a
thread-local symbol. */
* config/mips/mips-protos.h (mips_symbolic_constant_p) (mips_atomic_symbolic_constant_p, mips_stack_address_p) (mips_small_data_pattern_p): Declare. * config/mips/mips.h (CONST_GP_P): Moved from mips.c. (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Delete. * config/mips/mips.c (mips_symbolic_constant_p): Make global. (mips_atomic_symbolic_constant_p, mips_stack_address_p): New functions. (uns_arith_operand, const_arith_operand, arith_operand, sle_operand) (sleu_operand, small_int, reg_or_0_operand, const_float_1_operand) (reg_or_const_float_1_operand, hilo_operand, extend_operator) (macc_msac_operand, equality_op, cmp_op, trap_cmp_op) (pc_or_label_operand, call_insn_operand, move_operand) (consttable_operand, symbolic_operand, general_symbolic_operand) (global_got_operand, local_got_operand, stack_operand) (fp_register_operand, lo_operand, fcc_register_operand): Delete. (mips_small_data_pattern_1): Renamed from small_data_pattern_1. (mips_small_data_pattern_p): Replace previous small_data_pattern predicate. Turn into a bool () (rtx) function. * config/mips/predicates.md: New file. * config/mips/mips.md: Include it. Use the target-independent comparison_operator instead of cmp_op. Rename trap_cmp_op to trap_comparison_operator and equality_op to equality_operator. Replace uses of small_int with the equivalent const_arith_operand. Rename reg_or_const_float_1_operand to reg_or_1_operand. Rename const_float_1_operand to const_1_operand. Rename fcc_register_operand to fcc_reload_operand. * config/mips/sb1.md: Rename fp_register_operand to fpr_operand. From-SVN: r86006
2004-08-14 22:55:56 +02:00
static int
mips_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
* config/mips/mips-protos.h (mips_symbolic_constant_p) (mips_atomic_symbolic_constant_p, mips_stack_address_p) (mips_small_data_pattern_p): Declare. * config/mips/mips.h (CONST_GP_P): Moved from mips.c. (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Delete. * config/mips/mips.c (mips_symbolic_constant_p): Make global. (mips_atomic_symbolic_constant_p, mips_stack_address_p): New functions. (uns_arith_operand, const_arith_operand, arith_operand, sle_operand) (sleu_operand, small_int, reg_or_0_operand, const_float_1_operand) (reg_or_const_float_1_operand, hilo_operand, extend_operator) (macc_msac_operand, equality_op, cmp_op, trap_cmp_op) (pc_or_label_operand, call_insn_operand, move_operand) (consttable_operand, symbolic_operand, general_symbolic_operand) (global_got_operand, local_got_operand, stack_operand) (fp_register_operand, lo_operand, fcc_register_operand): Delete. (mips_small_data_pattern_1): Renamed from small_data_pattern_1. (mips_small_data_pattern_p): Replace previous small_data_pattern predicate. Turn into a bool () (rtx) function. * config/mips/predicates.md: New file. * config/mips/mips.md: Include it. Use the target-independent comparison_operator instead of cmp_op. Rename trap_cmp_op to trap_comparison_operator and equality_op to equality_operator. Replace uses of small_int with the equivalent const_arith_operand. Rename reg_or_const_float_1_operand to reg_or_1_operand. Rename const_float_1_operand to const_1_operand. Rename fcc_register_operand to fcc_reload_operand. * config/mips/sb1.md: Rename fp_register_operand to fpr_operand. From-SVN: r86006
2004-08-14 22:55:56 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return mips_tls_symbol_p (*x);
* config/mips/mips-protos.h (mips_symbolic_constant_p) (mips_atomic_symbolic_constant_p, mips_stack_address_p) (mips_small_data_pattern_p): Declare. * config/mips/mips.h (CONST_GP_P): Moved from mips.c. (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Delete. * config/mips/mips.c (mips_symbolic_constant_p): Make global. (mips_atomic_symbolic_constant_p, mips_stack_address_p): New functions. (uns_arith_operand, const_arith_operand, arith_operand, sle_operand) (sleu_operand, small_int, reg_or_0_operand, const_float_1_operand) (reg_or_const_float_1_operand, hilo_operand, extend_operator) (macc_msac_operand, equality_op, cmp_op, trap_cmp_op) (pc_or_label_operand, call_insn_operand, move_operand) (consttable_operand, symbolic_operand, general_symbolic_operand) (global_got_operand, local_got_operand, stack_operand) (fp_register_operand, lo_operand, fcc_register_operand): Delete. (mips_small_data_pattern_1): Renamed from small_data_pattern_1. (mips_small_data_pattern_p): Replace previous small_data_pattern predicate. Turn into a bool () (rtx) function. * config/mips/predicates.md: New file. * config/mips/mips.md: Include it. Use the target-independent comparison_operator instead of cmp_op. Rename trap_cmp_op to trap_comparison_operator and equality_op to equality_operator. Replace uses of small_int with the equivalent const_arith_operand. Rename reg_or_const_float_1_operand to reg_or_1_operand. Rename const_float_1_operand to const_1_operand. Rename fcc_register_operand to fcc_reload_operand. * config/mips/sb1.md: Rename fp_register_operand to fpr_operand. From-SVN: r86006
2004-08-14 22:55:56 +02:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_CANNOT_FORCE_CONST_MEM. */
1992-02-06 21:09:50 +01:00
static bool
mips_cannot_force_const_mem (rtx x)
1992-02-06 21:09:50 +01:00
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
enum mips_symbol_type type;
rtx base, offset;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* There is no assembler syntax for expressing an address-sized
high part. */
if (GET_CODE (x) == HIGH)
return true;
/* As an optimization, reject constants that mips_legitimize_move
can expand inline.
Suppose we have a multi-instruction sequence that loads constant C
into register R. If R does not get allocated a hard register, and
R is used in an operand that allows both registers and memory
references, reload will consider forcing C into memory and using
one of the instruction's memory alternatives. Returning false
here will force it to use an input reload instead. */
if (GET_CODE (x) == CONST_INT && LEGITIMATE_CONSTANT_P (x))
return true;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
split_const (x, &base, &offset);
if (mips_symbolic_constant_p (base, SYMBOL_CONTEXT_LEA, &type)
&& type != SYMBOL_FORCE_TO_MEM)
{
/* The same optimization as for CONST_INT. */
if (SMALL_INT (offset) && mips_symbol_insns (type, MAX_MACHINE_MODE) > 0)
return true;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* If MIPS16 constant pools live in the text section, they should
not refer to anything that might need run-time relocation. */
if (TARGET_MIPS16_PCREL_LOADS && mips_got_symbol_type_p (type))
return true;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* TLS symbols must be computed by mips_legitimize_move. */
if (for_each_rtx (&x, &mips_tls_symbol_ref_1, NULL))
return true;
return false;
}
1992-02-06 21:09:50 +01:00
/* Implement TARGET_USE_BLOCKS_FOR_CONSTANT_P. We can't use blocks for
constants when we're using a per-function constant pool. */
1992-02-06 21:09:50 +01:00
static bool
mips_use_blocks_for_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED,
const_rtx x ATTRIBUTE_UNUSED)
{
return !TARGET_MIPS16_PCREL_LOADS;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if register REGNO is a valid base register for mode MODE.
STRICT_P is true if REG_OK_STRICT is in effect. */
1992-02-06 21:09:50 +01:00
int
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_regno_mode_ok_for_base_p (int regno, enum machine_mode mode,
bool strict_p)
{
if (!HARD_REGISTER_NUM_P (regno))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!strict_p)
return true;
regno = reg_renumber[regno];
}
/* These fake registers will be eliminated to either the stack or
hard frame pointer, both of which are usually valid base registers.
Reload deals with the cases where the eliminated form isn't valid. */
if (regno == ARG_POINTER_REGNUM || regno == FRAME_POINTER_REGNUM)
return true;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* In MIPS16 mode, the stack pointer can only address word and doubleword
values, nothing smaller. There are two problems here:
(a) Instantiating virtual registers can introduce new uses of the
stack pointer. If these virtual registers are valid addresses,
the stack pointer should be too.
(b) Most uses of the stack pointer are not made explicit until
FRAME_POINTER_REGNUM and ARG_POINTER_REGNUM have been eliminated.
We don't know until that stage whether we'll be eliminating to the
stack pointer (which needs the restriction) or the hard frame
pointer (which doesn't).
All in all, it seems more consistent to only enforce this restriction
during and after reload. */
if (TARGET_MIPS16 && regno == STACK_POINTER_REGNUM)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return !strict_p || GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8;
return TARGET_MIPS16 ? M16_REG_P (regno) : GP_REG_P (regno);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if X is a valid base register for mode MODE.
STRICT_P is true if REG_OK_STRICT is in effect. */
static bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_valid_base_register_p (rtx x, enum machine_mode mode, bool strict_p)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!strict_p && GET_CODE (x) == SUBREG)
x = SUBREG_REG (x);
return (REG_P (x)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& mips_regno_mode_ok_for_base_p (REGNO (x), mode, strict_p));
}
/* Return true if, for every base register BASE_REG, (plus BASE_REG X)
can address a value of mode MODE. */
static bool
mips_valid_offset_p (rtx x, enum machine_mode mode)
{
/* Check that X is a signed 16-bit number. */
if (!const_arith_operand (x, Pmode))
return false;
/* We may need to split multiword moves, so make sure that every word
is accessible. */
if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
&& !SMALL_OPERAND (INTVAL (x) + GET_MODE_SIZE (mode) - UNITS_PER_WORD))
return false;
return true;
}
/* Return true if a LO_SUM can address a value of mode MODE when the
LO_SUM symbol has type SYMBOL_TYPE. */
static bool
mips_valid_lo_sum_p (enum mips_symbol_type symbol_type, enum machine_mode mode)
{
/* Check that symbols of type SYMBOL_TYPE can be used to access values
of mode MODE. */
if (mips_symbol_insns (symbol_type, mode) == 0)
return false;
/* Check that there is a known low-part relocation. */
if (mips_lo_relocs[symbol_type] == NULL)
return false;
/* We may need to split multiword moves, so make sure that each word
can be accessed without inducing a carry. This is mainly needed
for o64, which has historically only guaranteed 64-bit alignment
for 128-bit types. */
if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
&& GET_MODE_BITSIZE (mode) > GET_MODE_ALIGNMENT (mode))
return false;
return true;
}
/* Return true if X is a valid address for machine mode MODE. If it is,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fill in INFO appropriately. STRICT_P is true if REG_OK_STRICT is in
effect. */
static bool
mips_classify_address (struct mips_address_info *info, rtx x,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
enum machine_mode mode, bool strict_p)
{
switch (GET_CODE (x))
{
case REG:
case SUBREG:
info->type = ADDRESS_REG;
info->reg = x;
info->offset = const0_rtx;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return mips_valid_base_register_p (info->reg, mode, strict_p);
case PLUS:
info->type = ADDRESS_REG;
info->reg = XEXP (x, 0);
info->offset = XEXP (x, 1);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return (mips_valid_base_register_p (info->reg, mode, strict_p)
&& mips_valid_offset_p (info->offset, mode));
case LO_SUM:
info->type = ADDRESS_LO_SUM;
info->reg = XEXP (x, 0);
info->offset = XEXP (x, 1);
/* We have to trust the creator of the LO_SUM to do something vaguely
sane. Target-independent code that creates a LO_SUM should also
create and verify the matching HIGH. Target-independent code that
adds an offset to a LO_SUM must prove that the offset will not
induce a carry. Failure to do either of these things would be
a bug, and we are not required to check for it here. The MIPS
backend itself should only create LO_SUMs for valid symbolic
constants, with the high part being either a HIGH or a copy
of _gp. */
info->symbol_type
= mips_classify_symbolic_expression (info->offset, SYMBOL_CONTEXT_MEM);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return (mips_valid_base_register_p (info->reg, mode, strict_p)
&& mips_valid_lo_sum_p (info->symbol_type, mode));
case CONST_INT:
/* Small-integer addresses don't occur very often, but they
are legitimate if $0 is a valid base register. */
info->type = ADDRESS_CONST_INT;
return !TARGET_MIPS16 && SMALL_INT (x);
case CONST:
case LABEL_REF:
case SYMBOL_REF:
info->type = ADDRESS_SYMBOLIC;
return (mips_symbolic_constant_p (x, SYMBOL_CONTEXT_MEM,
&info->symbol_type)
&& mips_symbol_insns (info->symbol_type, mode) > 0
&& !mips_split_p[info->symbol_type]);
default:
return false;
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if X is a legitimate address for a memory operand of mode
MODE. STRICT_P is true if REG_OK_STRICT is in effect. */
bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_legitimate_address_p (enum machine_mode mode, rtx x, bool strict_p)
{
struct mips_address_info addr;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return mips_classify_address (&addr, x, mode, strict_p);
}
/* Return true if X is a legitimate $sp-based address for mode MDOE. */
bool
mips_stack_address_p (rtx x, enum machine_mode mode)
{
struct mips_address_info addr;
return (mips_classify_address (&addr, x, mode, false)
&& addr.type == ADDRESS_REG
&& addr.reg == stack_pointer_rtx);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if ADDR matches the pattern for the LWXS load scaled indexed
address instruction. Note that such addresses are not considered
legitimate in the GO_IF_LEGITIMATE_ADDRESS sense, because their use
is so restricted. */
static bool
mips_lwxs_address_p (rtx addr)
{
if (ISA_HAS_LWXS
&& GET_CODE (addr) == PLUS
&& REG_P (XEXP (addr, 1)))
{
rtx offset = XEXP (addr, 0);
if (GET_CODE (offset) == MULT
&& REG_P (XEXP (offset, 0))
&& GET_CODE (XEXP (offset, 1)) == CONST_INT
&& INTVAL (XEXP (offset, 1)) == 4)
return true;
}
return false;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if a value at OFFSET bytes from base register BASE can be
accessed using an unextended MIPS16 instruction. MODE is the mode of
the value.
Usually the offset in an unextended instruction is a 5-bit field.
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
The offset is unsigned and shifted left once for LH and SH, twice
for LW and SW, and so on. An exception is LWSP and SWSP, which have
an 8-bit immediate field that's shifted left twice. */
static bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_unextended_reference_p (enum machine_mode mode, rtx base,
unsigned HOST_WIDE_INT offset)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (offset % GET_MODE_SIZE (mode) == 0)
{
if (GET_MODE_SIZE (mode) == 4 && base == stack_pointer_rtx)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return offset < 256U * GET_MODE_SIZE (mode);
return offset < 32U * GET_MODE_SIZE (mode);
}
return false;
}
/* Return the number of instructions needed to load or store a value
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
of mode MODE at address X. Return 0 if X isn't valid for MODE.
Assume that multiword moves may need to be split into word moves
if MIGHT_SPLIT_P, otherwise assume that a single load or store is
enough.
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
For MIPS16 code, count extended instructions as two instructions. */
int
mips_address_insns (rtx x, enum machine_mode mode, bool might_split_p)
{
struct mips_address_info addr;
int factor;
/* BLKmode is used for single unaligned loads and stores and should
not count as a multiword mode. (GET_MODE_SIZE (BLKmode) is pretty
meaningless, so we have to single it out as a special case one way
or the other.) */
if (mode != BLKmode && might_split_p)
factor = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
else
factor = 1;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (mips_classify_address (&addr, x, mode, false))
switch (addr.type)
{
case ADDRESS_REG:
if (TARGET_MIPS16
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& !mips16_unextended_reference_p (mode, addr.reg,
UINTVAL (addr.offset)))
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return factor * 2;
return factor;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case ADDRESS_LO_SUM:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return TARGET_MIPS16 ? factor * 2 : factor;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case ADDRESS_CONST_INT:
return factor;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case ADDRESS_SYMBOLIC:
return factor * mips_symbol_insns (addr.symbol_type, mode);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
}
return 0;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return the number of instructions needed to load constant X.
Return 0 if X isn't a valid constant. */
int
mips_const_insns (rtx x)
{
struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS];
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
enum mips_symbol_type symbol_type;
rtx offset;
switch (GET_CODE (x))
{
case HIGH:
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
if (!mips_symbolic_constant_p (XEXP (x, 0), SYMBOL_CONTEXT_LEA,
&symbol_type)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
|| !mips_split_p[symbol_type])
return 0;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* This is simply an LUI for normal mode. It is an extended
LI followed by an extended SLL for MIPS16. */
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
return TARGET_MIPS16 ? 4 : 1;
1992-02-06 21:09:50 +01:00
case CONST_INT:
if (TARGET_MIPS16)
/* Unsigned 8-bit constants can be loaded using an unextended
LI instruction. Unsigned 16-bit constants can be loaded
using an extended LI. Negative constants must be loaded
using LI and then negated. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return (IN_RANGE (INTVAL (x), 0, 255) ? 1
: SMALL_OPERAND_UNSIGNED (INTVAL (x)) ? 2
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
: IN_RANGE (-INTVAL (x), 0, 255) ? 2
: SMALL_OPERAND_UNSIGNED (-INTVAL (x)) ? 3
: 0);
return mips_build_integer (codes, INTVAL (x));
1992-02-06 21:09:50 +01:00
case CONST_DOUBLE:
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
case CONST_VECTOR:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Allow zeros for normal mode, where we can use $0. */
return !TARGET_MIPS16 && x == CONST0_RTX (GET_MODE (x)) ? 1 : 0;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case CONST:
if (CONST_GP_P (x))
return 1;
/* See if we can refer to X directly. */
if (mips_symbolic_constant_p (x, SYMBOL_CONTEXT_LEA, &symbol_type))
return mips_symbol_insns (symbol_type, MAX_MACHINE_MODE);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
/* Otherwise try splitting the constant into a base and offset.
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
If the offset is a 16-bit value, we can load the base address
into a register and then use (D)ADDIU to add in the offset.
If the offset is larger, we can load the base and offset
into separate registers and add them together with (D)ADDU.
However, the latter is only possible before reload; during
and after reload, we must have the option of forcing the
constant into the pool instead. */
split_const (x, &x, &offset);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (offset != 0)
{
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
int n = mips_const_insns (x);
if (n != 0)
{
if (SMALL_INT (offset))
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return n + 1;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
else if (!targetm.cannot_force_const_mem (x))
return n + 1 + mips_build_integer (codes, INTVAL (offset));
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
}
}
return 0;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case SYMBOL_REF:
case LABEL_REF:
return mips_symbol_insns (mips_classify_symbol (x, SYMBOL_CONTEXT_LEA),
MAX_MACHINE_MODE);
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
default:
return 0;
}
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_split_const_insns): Declare. gcc/ * config/mips/mips-protos.h (mips_split_const_insns): Declare. * config/mips/mips.c (mips_split_const_insns): New function. * config/mips/mips.md (move_type): New attribute. (mode): Move attribute definition earlier in file. Add "TI" and "TF". (dword_mode): New attribute. (type): Avoid long line. Map "move_type"s to "type"s, choosing "multi" for doubleword moves if appropriate. Swap MTC/MFC comments to match their declaration order. (extended_mips16): Default to "yes" if "move_type" is "sll0", "type" is "branch" or "jal" is "direct". (length): Handle "extended_mips16" first. Make the default "0" for "ghost" instructions. Set the length from "move_type". (truncdisi2, truncdihi2, truncdiqi2): Use "move_type" instead of "type", with "sll0" for the register alternative. Remove the "extended_mips16" attribute. (zero_extendsidi2, *clear_upper32): Use "move_type" instead of "type", with "shift_shift" for the register alternative. Remove the "length" attribute. (*extend<SHORT:mode><GPR:mode>2, *extendqihi2): Likewise. (*zero_extend<SHORT:mode><GPR:mode>2): Use "move_type" instead of "type", with "andi" for the register alternative. (*zero_extendqihi2): Likewise. (*zero_extend<SHORT:mode><GPR:mode>2_mips16e): Use a "move_type" of "andi" instead of a "type" of "arith". (*zero_extend<SHORT:mode><GPR:mode>2_mips16): Use "move_type" instead of "type". (*zero_extendqihi2_mips16, mov_<load>l, mov_<load>r, mov_<store>l) (mov_<store>r, *mov<mode>_ra): Likewise. (extendsidi2): Use "move_type" instead of "type", with "move" for the register alternative. (*extend<SHORT:mode><GPR:mode>2_mips16e): Use "move_type" instead of "type", with "signext" for the register alternative. (*extend<SHORT:mode><GPR:mode>2_se<SHORT:size>): Likewise. (*extendqihi2_mips16e, *extendqihi2_seb): Likewise. (fix_truncdfsi2_insn, fix_truncsfsi2_insn, fix_truncdfdi2) (fix_truncsfdi2, floatsidf2, floatdidf2, floatsisf2, floatdisf2) (floatdisf2, *branch_equality<mode>_mips16): Likewise. (unnamed branch insn): Likewise. (*movdi_gp32_fp64): Fold into... (*movdi_32bit): ...here. (*movdf_hardfloat_64bit, *movdf_hardfloat_32bit): Combine into... (*movdf_hardfloat): ...this new pattern. (*movdf_softfloat): Remove redundant FPR alternatives. (*movti, *movti_mips16, *movtf, *movtf_mips16): Add "mode" attributes. (*movv2sf_hardfloat_64bit, *movv2sf_hardfloat_32bit): Combine into... (*movv2sf): ...this new pattern. Use "DF" rather than "SF" for the "move" attribute. (*movdi_32bit): Use "move_type" instead of "type" and remove the "length" attribute. Use "fpload" and "fpstore" instead of "load" and "store" for COP loads and stores. (*movdi_32bit_mips16, *movdi_64bit, *movsi_internal, movcc) (*movhi_internal, *movhi_mips16, *movqi_internal, *movqi_mips16) (*movsf_hardfloat, *movsf_softfloat, *movsi_mips16, *movdf_hardfloat) (*movdf_softfloat, *movdf_mips16, *movti, *movti_mips16, *movtf) (*movtf_mips16, *movv2sf): Likewise. (mfhi<GPR:mode>_<HILO:mode>, mflo<GPR:mode>_<HILO:mode>) (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): Use "move_type" instead of "move". (*low<mode>_mips16): Use "extended_mips16" instead of "length". (loadgp_blockage): Remove the "length" attribute. (blockage, set_got_version, update_got_version): Likewise. (call_internal): Remove the "extended_mips16" attribute. (call_value_internal, call_value_multiple_internal): Likewise. * config/mips/loongson.md (mov<mode>_internal): Use "move_type" instead of "move". * config/mips/mips-dsp.md (mips_lbux, mips_lhx, mips_lwx): Remove the "length" attribute. From-SVN: r137194
2008-06-27 19:20:32 +02:00
/* X is a doubleword constant that can be handled by splitting it into
two words and loading each word separately. Return the number of
instructions required to do this. */
int
mips_split_const_insns (rtx x)
{
unsigned int low, high;
low = mips_const_insns (mips_subword (x, false));
high = mips_const_insns (mips_subword (x, true));
gcc_assert (low > 0 && high > 0);
return low + high;
}
/* Return the number of instructions needed to implement INSN,
given that it loads from or stores to MEM. Count extended
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
MIPS16 instructions as two instructions. */
int
mips_load_store_insns (rtx mem, rtx insn)
{
enum machine_mode mode;
bool might_split_p;
rtx set;
gcc_assert (MEM_P (mem));
mode = GET_MODE (mem);
/* Try to prove that INSN does not need to be split. */
might_split_p = true;
if (GET_MODE_BITSIZE (mode) == 64)
{
set = single_set (insn);
if (set && !mips_split_64bit_move_p (SET_DEST (set), SET_SRC (set)))
might_split_p = false;
}
return mips_address_insns (XEXP (mem, 0), mode, might_split_p);
}
/* Return the number of instructions needed for an integer division. */
int
mips_idiv_insns (void)
{
int count;
count = 1;
if (TARGET_CHECK_ZERO_DIV)
{
if (GENERATE_DIVIDE_TRAPS)
count++;
else
count += 2;
}
if (TARGET_FIX_R4000 || TARGET_FIX_R4400)
count++;
return count;
}
/* Emit a move from SRC to DEST. Assume that the move expanders can
handle all moves if !can_create_pseudo_p (). The distinction is
important because, unlike emit_move_insn, the move expanders know
how to force Pmode objects into the constant pool even when the
constant pool address is not itself legitimate. */
rtx
mips_emit_move (rtx dest, rtx src)
{
return (can_create_pseudo_p ()
? emit_move_insn (dest, src)
: emit_move_insn_1 (dest, src));
}
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
/* Emit an instruction of the form (set TARGET (CODE OP0 OP1)). */
static void
mips_emit_binary (enum rtx_code code, rtx target, rtx op0, rtx op1)
{
emit_insn (gen_rtx_SET (VOIDmode, target,
gen_rtx_fmt_ee (code, GET_MODE (target), op0, op1)));
}
/* Compute (CODE OP0 OP1) and store the result in a new register
of mode MODE. Return that new register. */
static rtx
mips_force_binary (enum machine_mode mode, enum rtx_code code, rtx op0, rtx op1)
{
rtx reg;
reg = gen_reg_rtx (mode);
mips_emit_binary (code, reg, op0, op1);
return reg;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Copy VALUE to a register and return that register. If new pseudos
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
are allowed, copy it into a new register, otherwise use DEST. */
static rtx
mips_force_temporary (rtx dest, rtx value)
{
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 ())
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return force_reg (Pmode, value);
else
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_emit_move (dest, value);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return dest;
}
}
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
/* Emit a call sequence with call pattern PATTERN and return the call
instruction itself (which is not necessarily the last instruction
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
emitted). ORIG_ADDR is the original, unlegitimized address,
ADDR is the legitimized form, and LAZY_P is true if the call
address is lazily-bound. */
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
static rtx
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
mips_emit_call_insn (rtx pattern, rtx orig_addr, rtx addr, bool lazy_p)
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx insn, reg;
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
insn = emit_call_insn (pattern);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_MIPS16 && mips_use_pic_fn_addr_reg_p (orig_addr))
{
/* MIPS16 JALRs only take MIPS16 registers. If the target
function requires $25 to be valid on entry, we must copy it
there separately. The move instruction can be put in the
call's delay slot. */
reg = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
emit_insn_before (gen_move_insn (reg, addr), insn);
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg);
}
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
if (lazy_p)
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Lazy-binding stubs require $gp to be valid on entry. */
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
if (TARGET_USE_GOT)
{
/* See the comment above load_call<mode> for details. */
use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
gen_rtx_REG (Pmode, GOT_VERSION_REGNUM));
emit_insn (gen_update_got_version ());
}
return insn;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Wrap symbol or label BASE in an UNSPEC address of type SYMBOL_TYPE,
then add CONST_INT OFFSET to the result. */
static rtx
mips_unspec_address_offset (rtx base, rtx offset,
enum mips_symbol_type symbol_type)
{
base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base),
UNSPEC_ADDRESS_FIRST + symbol_type);
if (offset != const0_rtx)
base = gen_rtx_PLUS (Pmode, base, offset);
return gen_rtx_CONST (Pmode, base);
}
/* Return an UNSPEC address with underlying address ADDRESS and symbol
type SYMBOL_TYPE. */
rtx
mips_unspec_address (rtx address, enum mips_symbol_type symbol_type)
{
rtx base, offset;
split_const (address, &base, &offset);
return mips_unspec_address_offset (base, offset, symbol_type);
}
/* If mips_unspec_address (ADDR, SYMBOL_TYPE) is a 32-bit value, add the
high part to BASE and return the result. Just return BASE otherwise.
TEMP is as for mips_force_temporary.
The returned expression can be used as the first operand to a LO_SUM. */
static rtx
mips_unspec_offset_high (rtx temp, rtx base, rtx addr,
enum mips_symbol_type symbol_type)
{
if (mips_split_p[symbol_type])
{
addr = gen_rtx_HIGH (Pmode, mips_unspec_address (addr, symbol_type));
addr = mips_force_temporary (temp, addr);
base = mips_force_temporary (temp, gen_rtx_PLUS (Pmode, addr, base));
}
return base;
}
/* Return an instruction that copies $gp into register REG. We want
GCC to treat the register's value as constant, so that its value
can be rematerialized on demand. */
static rtx
gen_load_const_gp (rtx reg)
{
return (Pmode == SImode
? gen_load_const_gp_si (reg)
: gen_load_const_gp_di (reg));
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return a pseudo register that contains the value of $gp throughout
the current function. Such registers are needed by MIPS16 functions,
for which $gp itself is not a valid base register or addition operand. */
static rtx
mips16_gp_pseudo_reg (void)
{
if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX)
cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Don't emit an instruction to initialize the pseudo register if
we are being called from the tree optimizers' cost-calculation
routines. */
if (!cfun->machine->initialized_mips16_gp_pseudo_p
&& (current_ir_type () != IR_GIMPLE || currently_expanding_to_rtl))
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx insn, scan;
push_topmost_sequence ();
scan = get_insns ();
while (NEXT_INSN (scan) && !INSN_P (NEXT_INSN (scan)))
scan = NEXT_INSN (scan);
insn = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
emit_insn_after (insn, scan);
pop_topmost_sequence ();
cfun->machine->initialized_mips16_gp_pseudo_p = true;
}
return cfun->machine->mips16_gp_pseudo_rtx;
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Return a base register that holds pic_offset_table_rtx.
TEMP, if nonnull, is a scratch Pmode base register. */
rtx
mips_pic_base_register (rtx temp)
{
if (!TARGET_MIPS16)
return pic_offset_table_rtx;
if (can_create_pseudo_p ())
return mips16_gp_pseudo_reg ();
if (TARGET_USE_GOT)
/* The first post-reload split exposes all references to $gp
(both uses and definitions). All references must remain
explicit after that point.
It is safe to introduce uses of $gp at any time, so for
simplicity, we do that before the split too. */
mips_emit_move (temp, pic_offset_table_rtx);
else
emit_insn (gen_load_const_gp (temp));
return temp;
}
/* Create and return a GOT reference of type TYPE for address ADDR.
TEMP, if nonnull, is a scratch Pmode base register. */
rtx
mips_got_load (rtx temp, rtx addr, enum mips_symbol_type type)
{
rtx base, high, lo_sum_symbol;
base = mips_pic_base_register (temp);
/* If we used the temporary register to load $gp, we can't use
it for the high part as well. */
if (temp != NULL && reg_overlap_mentioned_p (base, temp))
temp = NULL;
high = mips_unspec_offset_high (temp, base, addr, type);
lo_sum_symbol = mips_unspec_address (addr, type);
if (type == SYMBOL_GOTOFF_CALL)
return (Pmode == SImode
? gen_unspec_callsi (high, lo_sum_symbol)
: gen_unspec_calldi (high, lo_sum_symbol));
else
return (Pmode == SImode
? gen_unspec_gotsi (high, lo_sum_symbol)
: gen_unspec_gotdi (high, lo_sum_symbol));
}
/* If MODE is MAX_MACHINE_MODE, ADDR appears as a move operand, otherwise
it appears in a MEM of that mode. Return true if ADDR is a legitimate
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
constant in that context and can be split into high and low parts.
If so, and if LOW_OUT is nonnull, emit the high part and store the
low part in *LOW_OUT. Leave *LOW_OUT unchanged otherwise.
TEMP is as for mips_force_temporary and is used to load the high
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
part into a register.
When MODE is MAX_MACHINE_MODE, the low part is guaranteed to be
a legitimize SET_SRC for an .md pattern, otherwise the low part
is guaranteed to be a legitimate address for mode MODE. */
bool
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
mips_split_symbol (rtx temp, rtx addr, enum machine_mode mode, rtx *low_out)
{
enum mips_symbol_context context;
enum mips_symbol_type symbol_type;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
rtx high;
context = (mode == MAX_MACHINE_MODE
? SYMBOL_CONTEXT_LEA
: SYMBOL_CONTEXT_MEM);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (GET_CODE (addr) == HIGH && context == SYMBOL_CONTEXT_LEA)
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
addr = XEXP (addr, 0);
if (mips_symbolic_constant_p (addr, context, &symbol_type)
&& mips_symbol_insns (symbol_type, mode) > 0
&& mips_split_hi_p[symbol_type])
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (low_out)
switch (symbol_type)
{
case SYMBOL_GOT_PAGE_OFST:
/* The high part of a page/ofst pair is loaded from the GOT. */
*low_out = mips_got_load (temp, addr, SYMBOL_GOTOFF_PAGE);
break;
default:
gcc_unreachable ();
}
return true;
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
}
else
{
if (mips_symbolic_constant_p (addr, context, &symbol_type)
&& mips_symbol_insns (symbol_type, mode) > 0
&& mips_split_p[symbol_type])
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (low_out)
switch (symbol_type)
{
case SYMBOL_GOT_DISP:
/* SYMBOL_GOT_DISP symbols are loaded from the GOT. */
*low_out = mips_got_load (temp, addr, SYMBOL_GOTOFF_DISP);
break;
case SYMBOL_GP_RELATIVE:
high = mips_pic_base_register (temp);
*low_out = gen_rtx_LO_SUM (Pmode, high, addr);
break;
default:
high = gen_rtx_HIGH (Pmode, copy_rtx (addr));
high = mips_force_temporary (temp, high);
*low_out = gen_rtx_LO_SUM (Pmode, high, addr);
break;
}
return true;
}
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
return false;
}
/* Return a legitimate address for REG + OFFSET. TEMP is as for
mips_force_temporary; it is only needed when OFFSET is not a
SMALL_OPERAND. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
static rtx
mips_add_offset (rtx temp, rtx reg, HOST_WIDE_INT offset)
{
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (!SMALL_OPERAND (offset))
{
rtx high;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TARGET_MIPS16)
{
/* Load the full offset into a register so that we can use
an unextended instruction for the address itself. */
high = GEN_INT (offset);
offset = 0;
}
else
{
/* Leave OFFSET as a 16-bit offset and put the excess in HIGH. */
high = GEN_INT (CONST_HIGH_PART (offset));
offset = CONST_LOW_PART (offset);
}
high = mips_force_temporary (temp, high);
reg = mips_force_temporary (temp, gen_rtx_PLUS (Pmode, high, reg));
}
return plus_constant (reg, offset);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The __tls_get_attr symbol. */
static GTY(()) rtx mips_tls_symbol;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return an instruction sequence that calls __tls_get_addr. SYM is
the TLS symbol we are referencing and TYPE is the symbol type to use
(either global dynamic or local dynamic). V0 is an RTX for the
return value location. */
static rtx
mips_call_tls_get_addr (rtx sym, enum mips_symbol_type type, rtx v0)
{
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
rtx insn, loc, a0;
a0 = gen_rtx_REG (Pmode, GP_ARG_FIRST);
if (!mips_tls_symbol)
mips_tls_symbol = init_one_libfunc ("__tls_get_addr");
loc = mips_unspec_address (sym, type);
start_sequence ();
emit_insn (gen_rtx_SET (Pmode, a0,
gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, loc)));
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
insn = mips_expand_call (MIPS_CALL_NORMAL, v0, mips_tls_symbol,
const0_rtx, NULL_RTX, false);
[multiple changes] 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> PATCH rtl/7335 PATCH rtl/33826 * see.c (see_copy_insn): Copy new pure const attributes for new call. * c-decl.c (merge_decls): Ditto. * postreload.c (record_opr_changes): Change CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree.c (define_local_buitin): Rename DECL_IS_PURE to DECL_PURE_P. Initialized DECL_LOOPING_CONST_PURE. (process_call_operands): Set tree_side_effects properly. * tree.h (TREE_READONLY_DECL_P): Removed. (DECL_IS_PURE): Renamed to DECL_PURE_P. (DECL_LOOPING_OR_CONST_P): New macro. (struct tree_function_decl): Added looping_const_or_pure_p. (ECF_*) Renumbered. (ECF_LOOPING_OR_CONST_P): New macro, * rtlanal.c (pure_const_p): Removed. * builtins.c (expand_builtin): Rename DECL_IS_PURE to DECL_PURE_P. * reorg.c (delete_prior_computation) Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * ipa-pure-const.c (pure_const_state_e): Added looping field. (check_decl, check_tree, check_call, scan_function): Initialize looping. (analyze_function): Rename DECL_IS_PURE to DECL_PURE_P. (static_execute): Set looping true for recursive functions. Undo setting state to IPA_NEITHER for recursive functions. * cse.c (cse_insn): * ifcvt.c (noce_can_store_speculate_p): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or RTL_CONST_OR_PURE_CALL_P. * dse.c (scan_insn): Ditto. * local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto. * gcse.c (oprs_not_seen_p) Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. (store_killed_in_insn): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P. * gimplify.c (gimplify_call_expr): Clear side effects for non-looping pure and constant calls. * calls.c (emit_call_1): Set rtl flags from ecf flags. (flags_from_decl_or_type): Set ecf flags from decl flags. (initialize_argument_information): Turn off ECF_LOOPING_CONST_OR_PURE when turning off ECF_CONST. Change const to pure if callee_copies is true rather than just turning off const. (expand_call): Turn off ECF_LOOPING_PURE_CONST_CALL and remove old way of marking pure calls. (emit_library_call_value_1): Turn off ECF_LOOPING_PURE_CONST_CALL. Remove hack that was supposed to fix pr7335 and remove old way of marking pure calls. * emit-rtl.c (emit_copy_of_insn_after): Copy RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P. * cselib.c (cselib_process_insn): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree-ssa-pre.c (can_value_number_call): Fixed spacing. * loop-invariant.c (find_exits, find_invariant_bb): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * sched-deps.c (schedule_analyze): Ditto. * rtl.h (struct rtx_def): Use call field, unchanging field, and return_val field of calls to represent pure and const function info. (CONST_OR_PURE_CALL_P): Deleted macro. (RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P, RTL_CONST_OR_PURE_P): New macros. * tree-inline.c (copy_body_r): Changed TREE_READONLY_DECL_P to TREE_READONLY. * tree-optimize.c (execute_fixup_cfg): Added test for ECF_LOOPING_CONST_OR_PURE. * c-common.c (handle_pure_attribute): Changed DECL_IS_PURE to DECL_PURE_P. * tree-cfg.c (update_call_expr_flags): Do not clear tree side effects for looping pure or const calls. (verify_gimple_expr): Added verification code. * config/alpha/alpha.c (alpha_legitimize_address, alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * config/s390/s390.c (s390_emit_tls_call_insn): Ditto. * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Ditto. * config/mips/mips.c (mips_call_tls_get_addr): Ditto. * cfgrtl.c (need_fake_edge_p): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * dce.c (deletable_insn_p): Allow non looping, non sibling, pure and const calls to be deleted. java: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (java_init_decl_processing): Change DECL_IS_PURE to DECL_PURE_P. cp: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY, DECL_LOOPING_CONST_OR_PURE_P attributes. * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to DECL_PURE_P. gfortran: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * trans-decl.c (gfc_get_extern_function_decl, build_function_decl): Rename DECL_IS_PURE to DECL_PURE_P. From-SVN: r135053
2008-05-07 22:48:07 +02:00
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), a0);
insn = get_insns ();
end_sequence ();
return insn;
}
/* Return a pseudo register that contains the current thread pointer. */
static rtx
mips_get_tp (void)
{
rtx tp;
tp = gen_reg_rtx (Pmode);
if (Pmode == DImode)
emit_insn (gen_tls_get_tp_di (tp));
else
emit_insn (gen_tls_get_tp_si (tp));
return tp;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Generate the code to access LOC, a thread-local SYMBOL_REF, and return
its address. The return value will be both a valid address and a valid
SET_SRC (either a REG or a LO_SUM). */
static rtx
mips_legitimize_tls_address (rtx loc)
{
rtx dest, insn, v0, tp, tmp1, tmp2, eqv;
enum tls_model model;
if (TARGET_MIPS16)
{
sorry ("MIPS16 TLS");
return gen_reg_rtx (Pmode);
}
model = SYMBOL_REF_TLS_MODEL (loc);
/* Only TARGET_ABICALLS code can have more than one module; other
code must be be static and should not use a GOT. All TLS models
reduce to local exec in this situation. */
if (!TARGET_ABICALLS)
model = TLS_MODEL_LOCAL_EXEC;
switch (model)
{
case TLS_MODEL_GLOBAL_DYNAMIC:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
v0 = gen_rtx_REG (Pmode, GP_RETURN);
insn = mips_call_tls_get_addr (loc, SYMBOL_TLSGD, v0);
dest = gen_reg_rtx (Pmode);
emit_libcall_block (insn, dest, v0, loc);
break;
case TLS_MODEL_LOCAL_DYNAMIC:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
v0 = gen_rtx_REG (Pmode, GP_RETURN);
insn = mips_call_tls_get_addr (loc, SYMBOL_TLSLDM, v0);
tmp1 = gen_reg_rtx (Pmode);
/* Attach a unique REG_EQUIV, to allow the RTL optimizers to
share the LDM result with other LD model accesses. */
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
UNSPEC_TLS_LDM);
emit_libcall_block (insn, tmp1, v0, eqv);
tmp2 = mips_unspec_offset_high (NULL, tmp1, loc, SYMBOL_DTPREL);
dest = gen_rtx_LO_SUM (Pmode, tmp2,
mips_unspec_address (loc, SYMBOL_DTPREL));
break;
case TLS_MODEL_INITIAL_EXEC:
tp = mips_get_tp ();
tmp1 = gen_reg_rtx (Pmode);
tmp2 = mips_unspec_address (loc, SYMBOL_GOTTPREL);
if (Pmode == DImode)
emit_insn (gen_load_gotdi (tmp1, pic_offset_table_rtx, tmp2));
else
emit_insn (gen_load_gotsi (tmp1, pic_offset_table_rtx, tmp2));
dest = gen_reg_rtx (Pmode);
emit_insn (gen_add3_insn (dest, tmp1, tp));
break;
case TLS_MODEL_LOCAL_EXEC:
tp = mips_get_tp ();
tmp1 = mips_unspec_offset_high (NULL, tp, loc, SYMBOL_TPREL);
dest = gen_rtx_LO_SUM (Pmode, tmp1,
mips_unspec_address (loc, SYMBOL_TPREL));
break;
default:
gcc_unreachable ();
}
return dest;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If X is not a valid address for mode MODE, force it into a register. */
static rtx
mips_force_address (rtx x, enum machine_mode mode)
{
if (!mips_legitimate_address_p (mode, x, false))
x = force_reg (Pmode, x);
return x;
}
/* This function is used to implement LEGITIMIZE_ADDRESS. If *XLOC can
be legitimized in a way that the generic machinery might not expect,
put the new address in *XLOC and return true. MODE is the mode of
the memory being accessed. */
bool
mips_legitimize_address (rtx *xloc, enum machine_mode mode)
{
rtx base, addr;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
HOST_WIDE_INT offset;
if (mips_tls_symbol_p (*xloc))
{
*xloc = mips_legitimize_tls_address (*xloc);
return true;
}
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
/* See if the address can split into a high part and a LO_SUM. */
if (mips_split_symbol (NULL, *xloc, mode, &addr))
{
*xloc = mips_force_address (addr, mode);
return true;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Handle BASE + OFFSET using mips_add_offset. */
mips_split_plus (*xloc, &base, &offset);
if (offset != 0)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!mips_valid_base_register_p (base, mode, false))
base = copy_to_mode_reg (Pmode, base);
addr = mips_add_offset (NULL, base, offset);
*xloc = mips_force_address (addr, mode);
return true;
}
return false;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Load VALUE into DEST. TEMP is as for mips_force_temporary. */
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_move_integer (rtx temp, rtx dest, unsigned HOST_WIDE_INT value)
{
struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS];
enum machine_mode mode;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned int i, num_ops;
rtx x;
mode = GET_MODE (dest);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
num_ops = mips_build_integer (codes, value);
/* Apply each binary operation to X. Invariant: X is a legitimate
source operand for a SET pattern. */
x = GEN_INT (codes[0].value);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
for (i = 1; i < num_ops; i++)
{
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_insn (gen_rtx_SET (VOIDmode, temp, x));
x = temp;
}
else
x = force_reg (mode, x);
x = gen_rtx_fmt_ee (codes[i].code, mode, x, GEN_INT (codes[i].value));
}
emit_insn (gen_rtx_SET (VOIDmode, dest, x));
}
/* Subroutine of mips_legitimize_move. Move constant SRC into register
DEST given that SRC satisfies immediate_operand but doesn't satisfy
move_operand. */
static void
mips_legitimize_const_move (enum machine_mode mode, rtx dest, rtx src)
{
rtx base, offset;
/* Split moves of big integers into smaller pieces. */
if (splittable_const_int_operand (src, mode))
{
mips_move_integer (dest, dest, INTVAL (src));
return;
}
/* Split moves of symbolic constants into high/low pairs. */
if (mips_split_symbol (dest, src, MAX_MACHINE_MODE, &src))
{
emit_insn (gen_rtx_SET (VOIDmode, dest, src));
return;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Generate the appropriate access sequences for TLS symbols. */
if (mips_tls_symbol_p (src))
{
mips_emit_move (dest, mips_legitimize_tls_address (src));
return;
}
/* If we have (const (plus symbol offset)), and that expression cannot
be forced into memory, load the symbol first and add in the offset.
In non-MIPS16 mode, prefer to do this even if the constant _can_ be
forced into memory, as it usually produces better code. */
split_const (src, &base, &offset);
if (offset != const0_rtx
&& (targetm.cannot_force_const_mem (src)
|| (!TARGET_MIPS16 && can_create_pseudo_p ())))
{
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
base = mips_force_temporary (dest, base);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_emit_move (dest, mips_add_offset (NULL, base, INTVAL (offset)));
return;
}
src = force_const_mem (mode, src);
/* When using explicit relocs, constant pool references are sometimes
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
not legitimate addresses. */
mips_split_symbol (dest, XEXP (src, 0), mode, &XEXP (src, 0));
mips_emit_move (dest, src);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If (set DEST SRC) is not a valid move instruction, emit an equivalent
sequence that is valid. */
bool
mips_legitimize_move (enum machine_mode mode, rtx dest, rtx src)
{
if (!register_operand (dest, mode) && !reg_or_0_operand (src, mode))
{
mips_emit_move (dest, force_reg (mode, src));
return true;
}
/* We need to deal with constants that would be legitimate
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
immediate_operands but aren't legitimate move_operands. */
if (CONSTANT_P (src) && !move_operand (src, mode))
{
mips_legitimize_const_move (mode, dest, src);
set_unique_reg_note (get_last_insn (), REG_EQUAL, copy_rtx (src));
return true;
}
return false;
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if value X in context CONTEXT is a small-data address
that can be rewritten as a LO_SUM. */
static bool
mips_rewrite_small_data_p (rtx x, enum mips_symbol_context context)
{
enum mips_symbol_type symbol_type;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
return (mips_lo_relocs[SYMBOL_GP_RELATIVE]
&& !mips_split_p[SYMBOL_GP_RELATIVE]
&& mips_symbolic_constant_p (x, context, &symbol_type)
&& symbol_type == SYMBOL_GP_RELATIVE);
}
/* A for_each_rtx callback for mips_small_data_pattern_p. DATA is the
containing MEM, or null if none. */
static int
mips_small_data_pattern_1 (rtx *loc, void *data)
{
enum mips_symbol_context context;
if (GET_CODE (*loc) == LO_SUM)
return -1;
if (MEM_P (*loc))
{
if (for_each_rtx (&XEXP (*loc, 0), mips_small_data_pattern_1, *loc))
return 1;
return -1;
}
context = data ? SYMBOL_CONTEXT_MEM : SYMBOL_CONTEXT_LEA;
return mips_rewrite_small_data_p (*loc, context);
}
/* Return true if OP refers to small data symbols directly, not through
a LO_SUM. */
bool
mips_small_data_pattern_p (rtx op)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return for_each_rtx (&op, mips_small_data_pattern_1, NULL);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* A for_each_rtx callback, used by mips_rewrite_small_data.
DATA is the containing MEM, or null if none. */
static int
mips_rewrite_small_data_1 (rtx *loc, void *data)
{
enum mips_symbol_context context;
if (MEM_P (*loc))
{
for_each_rtx (&XEXP (*loc, 0), mips_rewrite_small_data_1, *loc);
return -1;
}
context = data ? SYMBOL_CONTEXT_MEM : SYMBOL_CONTEXT_LEA;
if (mips_rewrite_small_data_p (*loc, context))
*loc = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, *loc);
if (GET_CODE (*loc) == LO_SUM)
return -1;
return 0;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Rewrite instruction pattern PATTERN so that it refers to small data
using explicit relocations. */
rtx
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_rewrite_small_data (rtx pattern)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
pattern = copy_insn (pattern);
for_each_rtx (&pattern, mips_rewrite_small_data_1, NULL);
return pattern;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* We need a lot of little routines to check the range of MIPS16 immediate
operands. */
static int
m16_check_op (rtx op, int low, int high, int mask)
{
return (GET_CODE (op) == CONST_INT
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& IN_RANGE (INTVAL (op), low, high)
&& (INTVAL (op) & mask) == 0);
}
int
m16_uimm3_b (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, 0x1, 0x8, 0);
}
int
m16_simm4_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x8, 0x7, 0);
}
int
m16_nsimm4_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x7, 0x8, 0);
}
int
m16_simm5_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x10, 0xf, 0);
}
int
m16_nsimm5_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0xf, 0x10, 0);
}
int
m16_uimm5_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x10 << 2, 0xf << 2, 3);
}
int
m16_nuimm5_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0xf << 2, 0x10 << 2, 3);
}
int
m16_simm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x80, 0x7f, 0);
}
int
m16_nsimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x7f, 0x80, 0);
}
int
m16_uimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, 0x0, 0xff, 0);
}
int
m16_nuimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0xff, 0x0, 0);
}
int
m16_uimm8_m1_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x1, 0xfe, 0);
}
int
m16_uimm8_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, 0x0, 0xff << 2, 3);
}
int
m16_nuimm8_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0xff << 2, 0x0, 3);
}
int
m16_simm8_8 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x80 << 3, 0x7f << 3, 7);
}
int
m16_nsimm8_8 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return m16_check_op (op, -0x7f << 3, 0x80 << 3, 7);
}
1992-02-06 21:09:50 +01:00
/* The cost of loading values from the constant pool. It should be
larger than the cost of any constant we want to synthesize inline. */
#define CONSTANT_POOL_COST COSTS_N_INSNS (TARGET_MIPS16 ? 4 : 8)
/* Return the cost of X when used as an operand to the MIPS16 instruction
that implements CODE. Return -1 if there is no such instruction, or if
X is not a valid immediate operand for it. */
static int
mips16_constant_cost (int code, HOST_WIDE_INT x)
{
switch (code)
{
case ASHIFT:
case ASHIFTRT:
case LSHIFTRT:
/* Shifts by between 1 and 8 bits (inclusive) are unextended,
other shifts are extended. The shift patterns truncate the shift
count to the right size, so there are no out-of-range values. */
if (IN_RANGE (x, 1, 8))
return 0;
return COSTS_N_INSNS (1);
case PLUS:
if (IN_RANGE (x, -128, 127))
return 0;
if (SMALL_OPERAND (x))
return COSTS_N_INSNS (1);
return -1;
case LEU:
/* Like LE, but reject the always-true case. */
if (x == -1)
return -1;
case LE:
/* We add 1 to the immediate and use SLT. */
x += 1;
case XOR:
/* We can use CMPI for an xor with an unsigned 16-bit X. */
case LT:
case LTU:
if (IN_RANGE (x, 0, 255))
return 0;
if (SMALL_OPERAND_UNSIGNED (x))
return COSTS_N_INSNS (1);
return -1;
case EQ:
case NE:
/* Equality comparisons with 0 are cheap. */
if (x == 0)
return 0;
return -1;
default:
return -1;
}
}
/* Return true if there is a non-MIPS16 instruction that implements CODE
and if that instruction accepts X as an immediate operand. */
static int
mips_immediate_operand_p (int code, HOST_WIDE_INT x)
{
switch (code)
{
case ASHIFT:
case ASHIFTRT:
case LSHIFTRT:
/* All shift counts are truncated to a valid constant. */
return true;
case ROTATE:
case ROTATERT:
/* Likewise rotates, if the target supports rotates at all. */
return ISA_HAS_ROR;
case AND:
case IOR:
case XOR:
/* These instructions take 16-bit unsigned immediates. */
return SMALL_OPERAND_UNSIGNED (x);
case PLUS:
case LT:
case LTU:
/* These instructions take 16-bit signed immediates. */
return SMALL_OPERAND (x);
case EQ:
case NE:
case GT:
case GTU:
/* The "immediate" forms of these instructions are really
implemented as comparisons with register 0. */
return x == 0;
case GE:
case GEU:
/* Likewise, meaning that the only valid immediate operand is 1. */
return x == 1;
case LE:
/* We add 1 to the immediate and use SLT. */
return SMALL_OPERAND (x + 1);
case LEU:
/* Likewise SLTU, but reject the always-true case. */
return SMALL_OPERAND (x + 1) && x + 1 != 0;
case SIGN_EXTRACT:
case ZERO_EXTRACT:
/* The bit position and size are immediate operands. */
return ISA_HAS_EXT_INS;
default:
/* By default assume that $0 can be used for 0. */
return x == 0;
}
}
/* Return the cost of binary operation X, given that the instruction
sequence for a word-sized or smaller operation has cost SINGLE_COST
and that the sequence of a double-word operation has cost DOUBLE_COST. */
static int
mips_binary_cost (rtx x, int single_cost, int double_cost)
{
int cost;
if (GET_MODE_SIZE (GET_MODE (x)) == UNITS_PER_WORD * 2)
cost = double_cost;
else
cost = single_cost;
return (cost
+ rtx_cost (XEXP (x, 0), 0)
+ rtx_cost (XEXP (x, 1), GET_CODE (x)));
}
/* Return the cost of floating-point multiplications of mode MODE. */
static int
mips_fp_mult_cost (enum machine_mode mode)
{
return mode == DFmode ? mips_cost->fp_mult_df : mips_cost->fp_mult_sf;
}
/* Return the cost of floating-point divisions of mode MODE. */
static int
mips_fp_div_cost (enum machine_mode mode)
{
return mode == DFmode ? mips_cost->fp_div_df : mips_cost->fp_div_sf;
}
/* Return the cost of sign-extending OP to mode MODE, not including the
cost of OP itself. */
static int
mips_sign_extend_cost (enum machine_mode mode, rtx op)
{
if (MEM_P (op))
/* Extended loads are as cheap as unextended ones. */
return 0;
if (TARGET_64BIT && mode == DImode && GET_MODE (op) == SImode)
/* A sign extension from SImode to DImode in 64-bit mode is free. */
return 0;
if (ISA_HAS_SEB_SEH || GENERATE_MIPS16E)
/* We can use SEB or SEH. */
return COSTS_N_INSNS (1);
/* We need to use a shift left and a shift right. */
return COSTS_N_INSNS (TARGET_MIPS16 ? 4 : 2);
}
/* Return the cost of zero-extending OP to mode MODE, not including the
cost of OP itself. */
static int
mips_zero_extend_cost (enum machine_mode mode, rtx op)
{
if (MEM_P (op))
/* Extended loads are as cheap as unextended ones. */
return 0;
if (TARGET_64BIT && mode == DImode && GET_MODE (op) == SImode)
/* We need a shift left by 32 bits and a shift right by 32 bits. */
return COSTS_N_INSNS (TARGET_MIPS16 ? 4 : 2);
if (GENERATE_MIPS16E)
/* We can use ZEB or ZEH. */
return COSTS_N_INSNS (1);
if (TARGET_MIPS16)
/* We need to load 0xff or 0xffff into a register and use AND. */
return COSTS_N_INSNS (GET_MODE (op) == QImode ? 2 : 3);
/* We can use ANDI. */
return COSTS_N_INSNS (1);
}
/* Implement TARGET_RTX_COSTS. */
static bool
mips_rtx_costs (rtx x, int code, int outer_code, int *total)
{
enum machine_mode mode = GET_MODE (x);
bool float_mode_p = FLOAT_MODE_P (mode);
int cost;
rtx addr;
/* The cost of a COMPARE is hard to define for MIPS. COMPAREs don't
appear in the instruction stream, and the cost of a comparison is
really the cost of the branch or scc condition. At the time of
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
writing, GCC only uses an explicit outer COMPARE code when optabs
is testing whether a constant is expensive enough to force into a
register. We want optabs to pass such constants through the MIPS
expanders instead, so make all constants very cheap here. */
if (outer_code == COMPARE)
{
gcc_assert (CONSTANT_P (x));
*total = 0;
return true;
}
switch (code)
{
case CONST_INT:
/* Treat *clear_upper32-style ANDs as having zero cost in the
second operand. The cost is entirely in the first operand.
??? This is needed because we would otherwise try to CSE
the constant operand. Although that's the right thing for
instructions that continue to be a register operation throughout
compilation, it is disastrous for instructions that could
later be converted into a memory operation. */
if (TARGET_64BIT
&& outer_code == AND
&& UINTVAL (x) == 0xffffffff)
{
*total = 0;
return true;
}
if (TARGET_MIPS16)
{
cost = mips16_constant_cost (outer_code, INTVAL (x));
if (cost >= 0)
{
*total = cost;
return true;
}
}
else
{
/* When not optimizing for size, we care more about the cost
of hot code, and hot code is often in a loop. If a constant
operand needs to be forced into a register, we will often be
able to hoist the constant load out of the loop, so the load
should not contribute to the cost. */
if (!optimize_size
|| mips_immediate_operand_p (outer_code, INTVAL (x)))
{
*total = 0;
return true;
}
}
/* Fall through. */
case CONST:
case SYMBOL_REF:
case LABEL_REF:
case CONST_DOUBLE:
if (force_to_mem_operand (x, VOIDmode))
{
*total = COSTS_N_INSNS (1);
return true;
}
cost = mips_const_insns (x);
if (cost > 0)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
{
/* If the constant is likely to be stored in a GPR, SETs of
single-insn constants are as cheap as register sets; we
never want to CSE them.
Don't reduce the cost of storing a floating-point zero in
FPRs. If we have a zero in an FPR for other reasons, we
can get better cfg-cleanup and delayed-branch results by
using it consistently, rather than using $0 sometimes and
an FPR at other times. Also, moves between floating-point
registers are sometimes cheaper than (D)MTC1 $0. */
if (cost == 1
&& outer_code == SET
&& !(float_mode_p && TARGET_HARD_FLOAT))
cost = 0;
/* When non-MIPS16 code loads a constant N>1 times, we rarely
want to CSE the constant itself. It is usually better to
have N copies of the last operation in the sequence and one
shared copy of the other operations. (Note that this is
not true for MIPS16 code, where the final operation in the
sequence is often an extended instruction.)
Also, if we have a CONST_INT, we don't know whether it is
for a word or doubleword operation, so we cannot rely on
the result of mips_build_integer. */
else if (!TARGET_MIPS16
&& (outer_code == SET || mode == VOIDmode))
cost = 1;
*total = COSTS_N_INSNS (cost);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return true;
}
/* The value will need to be fetched from the constant pool. */
*total = CONSTANT_POOL_COST;
return true;
case MEM:
/* If the address is legitimate, return the number of
instructions it needs. */
addr = XEXP (x, 0);
cost = mips_address_insns (addr, mode, true);
if (cost > 0)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
{
*total = COSTS_N_INSNS (cost + 1);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return true;
}
/* Check for a scaled indexed address. */
if (mips_lwxs_address_p (addr))
{
*total = COSTS_N_INSNS (2);
return true;
}
/* Otherwise use the default handling. */
return false;
case FFS:
*total = COSTS_N_INSNS (6);
return false;
case NOT:
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode) > UNITS_PER_WORD ? 2 : 1);
return false;
case AND:
/* Check for a *clear_upper32 pattern and treat it like a zero
extension. See the pattern's comment for details. */
if (TARGET_64BIT
&& mode == DImode
&& CONST_INT_P (XEXP (x, 1))
&& UINTVAL (XEXP (x, 1)) == 0xffffffff)
{
*total = (mips_zero_extend_cost (mode, XEXP (x, 0))
+ rtx_cost (XEXP (x, 0), 0));
return true;
}
/* Fall through. */
case IOR:
case XOR:
/* Double-word operations use two single-word operations. */
*total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (2));
return true;
case ASHIFT:
case ASHIFTRT:
case LSHIFTRT:
case ROTATE:
case ROTATERT:
if (CONSTANT_P (XEXP (x, 1)))
*total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (4));
else
*total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (12));
return true;
case ABS:
if (float_mode_p)
*total = mips_cost->fp_add;
else
*total = COSTS_N_INSNS (4);
return false;
case LO_SUM:
/* Low-part immediates need an extended MIPS16 instruction. */
*total = (COSTS_N_INSNS (TARGET_MIPS16 ? 2 : 1)
+ rtx_cost (XEXP (x, 0), 0));
return true;
case LT:
case LTU:
case LE:
case LEU:
case GT:
case GTU:
case GE:
case GEU:
case EQ:
case NE:
case UNORDERED:
case LTGT:
/* Branch comparisons have VOIDmode, so use the first operand's
mode instead. */
mode = GET_MODE (XEXP (x, 0));
if (FLOAT_MODE_P (mode))
{
*total = mips_cost->fp_add;
return false;
}
*total = mips_binary_cost (x, COSTS_N_INSNS (1), COSTS_N_INSNS (4));
return true;
case MINUS:
if (float_mode_p
&& (ISA_HAS_NMADD4_NMSUB4 (mode) || ISA_HAS_NMADD3_NMSUB3 (mode))
&& TARGET_FUSED_MADD
&& !HONOR_NANS (mode)
&& !HONOR_SIGNED_ZEROS (mode))
{
/* See if we can use NMADD or NMSUB. See mips.md for the
associated patterns. */
rtx op0 = XEXP (x, 0);
rtx op1 = XEXP (x, 1);
if (GET_CODE (op0) == MULT && GET_CODE (XEXP (op0, 0)) == NEG)
{
*total = (mips_fp_mult_cost (mode)
+ rtx_cost (XEXP (XEXP (op0, 0), 0), 0)
+ rtx_cost (XEXP (op0, 1), 0)
+ rtx_cost (op1, 0));
return true;
}
if (GET_CODE (op1) == MULT)
{
*total = (mips_fp_mult_cost (mode)
+ rtx_cost (op0, 0)
+ rtx_cost (XEXP (op1, 0), 0)
+ rtx_cost (XEXP (op1, 1), 0));
return true;
}
}
/* Fall through. */
case PLUS:
if (float_mode_p)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If this is part of a MADD or MSUB, treat the PLUS as
being free. */
if (ISA_HAS_FP4
&& TARGET_FUSED_MADD
&& GET_CODE (XEXP (x, 0)) == MULT)
*total = 0;
else
*total = mips_cost->fp_add;
return false;
}
/* Double-word operations require three single-word operations and
an SLTU. The MIPS16 version then needs to move the result of
the SLTU from $24 to a MIPS16 register. */
*total = mips_binary_cost (x, COSTS_N_INSNS (1),
COSTS_N_INSNS (TARGET_MIPS16 ? 5 : 4));
return true;
case NEG:
if (float_mode_p
&& (ISA_HAS_NMADD4_NMSUB4 (mode) || ISA_HAS_NMADD3_NMSUB3 (mode))
&& TARGET_FUSED_MADD
&& !HONOR_NANS (mode)
&& HONOR_SIGNED_ZEROS (mode))
{
/* See if we can use NMADD or NMSUB. See mips.md for the
associated patterns. */
rtx op = XEXP (x, 0);
if ((GET_CODE (op) == PLUS || GET_CODE (op) == MINUS)
&& GET_CODE (XEXP (op, 0)) == MULT)
{
*total = (mips_fp_mult_cost (mode)
+ rtx_cost (XEXP (XEXP (op, 0), 0), 0)
+ rtx_cost (XEXP (XEXP (op, 0), 1), 0)
+ rtx_cost (XEXP (op, 1), 0));
return true;
}
}
if (float_mode_p)
*total = mips_cost->fp_add;
else
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode) > UNITS_PER_WORD ? 4 : 1);
return false;
case MULT:
if (float_mode_p)
*total = mips_fp_mult_cost (mode);
else if (mode == DImode && !TARGET_64BIT)
/* Synthesized from 2 mulsi3s, 1 mulsidi3 and two additions,
where the mulsidi3 always includes an MFHI and an MFLO. */
*total = (optimize_size
? COSTS_N_INSNS (ISA_HAS_MUL3 ? 7 : 9)
: mips_cost->int_mult_si * 3 + 6);
else if (optimize_size)
*total = (ISA_HAS_MUL3 ? 1 : 2);
else if (mode == DImode)
*total = mips_cost->int_mult_di;
else
*total = mips_cost->int_mult_si;
return false;
case DIV:
/* Check for a reciprocal. */
if (float_mode_p
&& ISA_HAS_FP4
&& flag_unsafe_math_optimizations
&& XEXP (x, 0) == CONST1_RTX (mode))
{
if (outer_code == SQRT || GET_CODE (XEXP (x, 1)) == SQRT)
/* An rsqrt<mode>a or rsqrt<mode>b pattern. Count the
division as being free. */
*total = rtx_cost (XEXP (x, 1), 0);
else
*total = mips_fp_div_cost (mode) + rtx_cost (XEXP (x, 1), 0);
return true;
}
/* Fall through. */
case SQRT:
case MOD:
if (float_mode_p)
{
*total = mips_fp_div_cost (mode);
return false;
}
/* Fall through. */
case UDIV:
case UMOD:
if (optimize_size)
{
/* It is our responsibility to make division by a power of 2
as cheap as 2 register additions if we want the division
expanders to be used for such operations; see the setting
of sdiv_pow2_cheap in optabs.c. Using (D)DIV for MIPS16
should always produce shorter code than using
expand_sdiv2_pow2. */
if (TARGET_MIPS16
&& CONST_INT_P (XEXP (x, 1))
&& exact_log2 (INTVAL (XEXP (x, 1))) >= 0)
{
*total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), 0);
return true;
}
*total = COSTS_N_INSNS (mips_idiv_insns ());
}
else if (mode == DImode)
*total = mips_cost->int_div_di;
else
*total = mips_cost->int_div_si;
return false;
case SIGN_EXTEND:
*total = mips_sign_extend_cost (mode, XEXP (x, 0));
return false;
case ZERO_EXTEND:
*total = mips_zero_extend_cost (mode, XEXP (x, 0));
return false;
case FLOAT:
case UNSIGNED_FLOAT:
case FIX:
case FLOAT_EXTEND:
case FLOAT_TRUNCATE:
*total = mips_cost->fp_add;
return false;
default:
return false;
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_ADDRESS_COST. */
static int
mips_address_cost (rtx addr)
{
return mips_address_insns (addr, SImode, false);
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
/* Return one word of double-word value OP, taking into account the fixed
endianness of certain registers. HIGH_P is true to select the high part,
false to select the low part. */
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
rtx
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_subword (rtx op, bool high_p)
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
{
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
unsigned int byte, offset;
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
enum machine_mode mode;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
mode = GET_MODE (op);
if (mode == VOIDmode)
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
mode = TARGET_64BIT ? TImode : DImode;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (TARGET_BIG_ENDIAN ? !high_p : high_p)
byte = UNITS_PER_WORD;
else
byte = 0;
1992-02-06 21:09:50 +01:00
if (FP_REG_RTX_P (op))
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
{
/* Paired FPRs are always ordered little-endian. */
offset = (UNITS_PER_WORD < UNITS_PER_HWFPVALUE ? high_p : byte != 0);
return gen_rtx_REG (word_mode, REGNO (op) + offset);
}
1992-02-06 21:09:50 +01:00
if (MEM_P (op))
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return mips_rewrite_small_data (adjust_address (op, word_mode, byte));
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
return simplify_gen_subreg (word_mode, op, mode, byte);
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
/* Return true if a 64-bit move from SRC to DEST should be split into two. */
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
bool
mips_split_64bit_move_p (rtx dest, rtx src)
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
{
if (TARGET_64BIT)
return false;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* FPR-to-FPR moves can be done in a single instruction, if they're
allowed at all. */
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (FP_REG_RTX_P (src) && FP_REG_RTX_P (dest))
return false;
1992-02-06 21:09:50 +01:00
/* Check for floating-point loads and stores. */
if (ISA_HAS_LDC1_SDC1)
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
{
if (FP_REG_RTX_P (dest) && MEM_P (src))
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
return false;
if (FP_REG_RTX_P (src) && MEM_P (dest))
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
return false;
}
return true;
}
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
/* Split a doubleword move from SRC to DEST. On 32-bit targets,
this function handles 64-bit moves for which mips_split_64bit_move_p
holds. For 64-bit targets, this function handles 128-bit moves. */
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
void
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
mips_split_doubleword_move (rtx dest, rtx src)
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
{
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
rtx low_dest;
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
if (FP_REG_RTX_P (dest) || FP_REG_RTX_P (src))
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
{
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
if (!TARGET_64BIT && GET_MODE (dest) == DImode)
emit_insn (gen_move_doubleword_fprdi (dest, src));
else if (!TARGET_64BIT && GET_MODE (dest) == DFmode)
emit_insn (gen_move_doubleword_fprdf (dest, src));
invoke.texi (-mpaired-single): Don't say that the option requires 64-bit code. gcc/ * doc/invoke.texi (-mpaired-single): Don't say that the option requires 64-bit code. * config/mips/mips-protos.h (mips_modes_tieable_p): Declare. * config/mips/mips.h (ISA_HAS_PAIRED_SINGLE): New macro. (ISA_HAS_NMADD_NMSUB): Add a mode argument. Return true for V2SF if ISA_MIPS32R2. (MODES_TIEABLE_P): Use mips_modes_tieable_p. * config/mips/mips.c (mips_rtx_costs): Pass a mode argument to ISA_HAS_NMADD_NMSUB. (mips_split_doubleword_move): Handle V2SF. (mips_modes_tieable_p): New function. (override_options): Report a warning rather than an error when -mpaired-single is used on ISAs that don't support it; use ISA_HAS_PAIRED_SINGLE to check that case. * config/mips/mips.md (MOVE64): New mode iterator. Replace DI and DF move splitters with a single MOVE64 splitter, thereby adding a V2SF splitter too. (SPLITF): Add TARGET_DOUBLE_FLOAT conditions to DI and DF. Add a TARGET_FLOAT64 condition to TF. Add V2SF to the iterator. (HALFMODE): Add V2SF. (*nmadd<mode>, *nmadd<mode>_fastmath, *nmsub<mode>) (*nmsub<mode>_fastmath): Add a mode argument to ISA_HAS_NMADD_NMSUB. (movv2sf_hardfloat_64bit): Tweak ordering of conditions. (movv2sf_hardfloat_32bit): New pattern. (load_low<mode>, load_high<mode>, store_word<mode>): Remove TARGET_DOUBLE_FLOAT conditions. gcc/testsuite/ * gcc.dg/vect/vect.exp: Extend -mpaired-single handling to all MIPS targets. * g++.dg/vect/vect.exp: Likewise. * lib/fortran-torture.exp: Likewise. * gcc.target/mips/mips-ps-1.c: Use mpaired_single rather than mipsisa64*-*-* as the target selector. Remove -mips64, -mhard-float and -mgp64 from the options list. * gcc.target/mips/mips-ps-2.c: Likewise. * gcc.target/mips/mips-ps-3.c: Likewise. * gcc.target/mips/mips-ps-4.c: Likewise. * gcc.target/mips/mips-ps-6.c: Likewise. * gcc.target/mips/mips-ps-5.c: Remove -mhard-float from the options list. * gcc.target/mips/sb1-1.c: Likewise. * gcc.target/mips/mips-ps-type.c: Likewise. * gcc.target/mips/mips-ps-7.c: New test. * gcc.target/mips/mips-ps-type-2.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Remove XFAIL. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_fp and mips_gp instead of mips_fp64 and mips_gp64. Treat -mgp32 -mfp64 as forcing an ABI and an architecture. (is_gp32_flag, is_gp64_flag): Fold into... (dg-mips-options): ...here. Make -mpaired-single imply -mfp64, then -mfp64 imply -mhard-float. Apply register rules after the loop. Handle -march=mipsN like -mipsN. From-SVN: r129522
2007-10-21 11:07:13 +02:00
else if (!TARGET_64BIT && GET_MODE (dest) == V2SFmode)
emit_insn (gen_move_doubleword_fprv2sf (dest, src));
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
else if (!TARGET_64BIT && GET_MODE (dest) == V2SImode)
emit_insn (gen_move_doubleword_fprv2si (dest, src));
else if (!TARGET_64BIT && GET_MODE (dest) == V4HImode)
emit_insn (gen_move_doubleword_fprv4hi (dest, src));
else if (!TARGET_64BIT && GET_MODE (dest) == V8QImode)
emit_insn (gen_move_doubleword_fprv8qi (dest, src));
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
else if (TARGET_64BIT && GET_MODE (dest) == TFmode)
emit_insn (gen_move_doubleword_fprtf (dest, src));
mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. gcc: * config/mips/mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. (ISA_HAS_MXHC1): True if ISA supports mfhc1 and mthc1 opcodes. (ASM_SPEC): Pass along -mfp32 and -mfp64. * config/mips/mips.c (mips_split_64bit_move): Use gen_mthc1 to set high part of FP register when in 64-bit FP register mode. Similarly use gen_mfhc1 to load high part of FP register. (override_options): Allow -mgp32 and -mfp64 combination if ISA_HAS_MXHC1 (currently for O32 only). (mips_cannot_change_mode_class): If floating-point registers are bigger than word size. disallow conversion of float register from a large integer mode to a float mode smaller than the float register size. (mips_class_max_nregs): Handle float registers case seperately. * config/mips/mips.md (define_constants): Add UNSPEC_MFHC1, UNSPEC_MTHC1. (movdi_32bit): Use !TARGET_FLOAT64 in condition pattern. (movdf_hardfloat_32bit): Similarly. (movdi_gp32_fp64): New DImode pattern for MIPS32R2 which optionally support a full 64-bit fpu. (mthc1): New pattern to generate MTHC1 instruction. (mfhc1): New pattern to generate MFHC1 instruction. * doc/invoke.texi (MIPS Options): Document the -mgp32 -mfp64 option for the MIPS32R2 and mention its use under O32 ABI. gcc/testsuite: * gcc.target/mips/mips.exp (dg-mips-options): Handle parsing of -mfp64, allowable when ISA >= 33 and float is enabled. * gcc.target/mips/mips32r2-mxhc1.c: New test for checking the use of mthc1 and mfhc1 patterns. From-SVN: r119124
2006-11-23 17:13:46 +01:00
else
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5) gcc/ PR target/33635 * config/mips/mips-protos.h (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this. * config/mips/mips.c (mips_subword): Extend to handle 64-bit words; use natural endianness for multi-format FPR values. (mips_split_64bit_move): Rename to... (mips_split_doubleword_move): ...this and extend to 64-bit words. Use move_doubleword_fpr* patterns for moves involving FPRs. (mips_save_reg): Update the call to mips_split_64bit_move. (mips_secondary_reload_class): Return NO_REGS for any reload of a nonzero constant into an FPR if the constant can be forced to memory. * config/mips/mips.md: Update the splitter calls to mips_split_64bit_move. (UNSPEC_LOAD_DF_LOW): Rename to... (UNSPEC_LOAD_LOW): ...this. (UNSPEC_LOAD_DF_HIGH): Rename to... (UNSPEC_LOAD_HIGH): ...this. (UNSPEC_STORE_DF_HIGH): Rename to... (UNSPEC_STORE_WORD): ...this. (SPLITF): New mode iterator. (HALFMODE): New mode attribute. (movtf): New expander. (*movtf_internal): New define_insn_and_split. (move_doubleword_fpr<mode>): New expander. (load_df_low, load_df_high, store_df_high, mthc1, mfhc1): Replace with... (load_low<mode>, load_high<mode>, store_word<mode>, mthc1<mode>) (mfhc1<mode>): ...these more general patterns. gcc/testsuite/ PR target/33635 * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_isa_rev and mips_forced_be. (dg-mips-options): Handle -EL and -mel. Make -mfp64 imply -mhard-float and a suitable ISA. Improve handling of -mipsXrY options. * gcc.target/mips/fpr-moves-1.c: New test. * gcc.target/mips/fpr-moves-2.c: Likewise. * gcc.target/mips/fpr-moves-3.c: Likewise. * gcc.target/mips/fpr-moves-4.c: Likewise. * gcc.target/mips/fpr-moves-5.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Likewise. * gcc.target/mips/mips32r2-mxhc1.c: Remove -march=mips32r2 From-SVN: r128991
2007-10-03 20:39:30 +02:00
gcc_unreachable ();
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
}
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
else if (REG_P (dest) && REGNO (dest) == MD_REG_FIRST)
{
low_dest = mips_subword (dest, false);
mips_emit_move (low_dest, mips_subword (src, false));
if (TARGET_64BIT)
emit_insn (gen_mthidi_ti (dest, mips_subword (src, true), low_dest));
else
emit_insn (gen_mthisi_di (dest, mips_subword (src, true), low_dest));
}
else if (REG_P (src) && REGNO (src) == MD_REG_FIRST)
{
mips_emit_move (mips_subword (dest, false), mips_subword (src, false));
if (TARGET_64BIT)
emit_insn (gen_mfhidi_ti (mips_subword (dest, true), src));
else
emit_insn (gen_mfhisi_di (mips_subword (dest, true), src));
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
else
{
/* The operation can be split into two normal moves. Decide in
which order to do them. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
low_dest = mips_subword (dest, false);
if (REG_P (low_dest)
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
&& reg_overlap_mentioned_p (low_dest, src))
1992-02-06 21:09:50 +01:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_emit_move (mips_subword (dest, true), mips_subword (src, true));
mips_emit_move (low_dest, mips_subword (src, false));
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
else
1992-02-06 21:09:50 +01:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_emit_move (low_dest, mips_subword (src, false));
mips_emit_move (mips_subword (dest, true), mips_subword (src, true));
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
}
}
/* Return the appropriate instructions to move SRC into DEST. Assume
that SRC is operand 1 and DEST is operand 0. */
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
const char *
mips_output_move (rtx dest, rtx src)
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
{
enum rtx_code dest_code, src_code;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
enum machine_mode mode;
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
enum mips_symbol_type symbol_type;
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
bool dbl_p;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
dest_code = GET_CODE (dest);
src_code = GET_CODE (src);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mode = GET_MODE (dest);
dbl_p = (GET_MODE_SIZE (mode) == 8);
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (dbl_p && mips_split_64bit_move_p (dest, src))
return "#";
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if ((src_code == REG && GP_REG_P (REGNO (src)))
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
|| (!TARGET_MIPS16 && src == CONST0_RTX (mode)))
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
{
if (dest_code == REG)
{
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (GP_REG_P (REGNO (dest)))
return "move\t%0,%z1";
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
/* Moves to HI are handled by special .md insns. */
if (REGNO (dest) == LO_REGNUM)
return "mtlo\t%z1";
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
if (DSP_ACC_REG_P (REGNO (dest)))
{
static char retval[] = "mt__\t%z1,%q0";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
retval[2] = reg_names[REGNO (dest)][4];
retval[3] = reg_names[REGNO (dest)][5];
return retval;
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (FP_REG_P (REGNO (dest)))
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? "dmtc1\t%z1,%0" : "mtc1\t%z1,%0";
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (ALL_COP_REG_P (REGNO (dest)))
{
static char retval[] = "dmtc_\t%z1,%0";
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
retval[4] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (dest));
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? retval : retval + 1;
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
}
}
if (dest_code == MEM)
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
switch (GET_MODE_SIZE (mode))
{
case 1: return "sb\t%z1,%0";
case 2: return "sh\t%z1,%0";
case 4: return "sw\t%z1,%0";
case 8: return "sd\t%z1,%0";
}
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (dest_code == REG && GP_REG_P (REGNO (dest)))
1992-02-06 21:09:50 +01:00
{
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (src_code == REG)
1992-02-06 21:09:50 +01:00
{
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
/* Moves from HI are handled by special .md insns. */
if (REGNO (src) == LO_REGNUM)
{
/* When generating VR4120 or VR4130 code, we use MACC and
DMACC instead of MFLO. This avoids both the normal
MIPS III HI/LO hazards and the errata related to
-mfix-vr4130. */
if (ISA_HAS_MACCHI)
return dbl_p ? "dmacc\t%0,%.,%." : "macc\t%0,%.,%.";
return "mflo\t%0";
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
if (DSP_ACC_REG_P (REGNO (src)))
{
static char retval[] = "mf__\t%0,%q1";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
retval[2] = reg_names[REGNO (src)][4];
retval[3] = reg_names[REGNO (src)][5];
return retval;
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (FP_REG_P (REGNO (src)))
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? "dmfc1\t%0,%1" : "mfc1\t%0,%1";
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (ALL_COP_REG_P (REGNO (src)))
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
{
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
static char retval[] = "dmfc_\t%0,%1";
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
retval[4] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (src));
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? retval : retval + 1;
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (ST_REG_P (REGNO (src)) && ISA_HAS_8CC)
return "lui\t%0,0x3f80\n\tmovf\t%0,%.,%1";
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (src_code == MEM)
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
switch (GET_MODE_SIZE (mode))
{
case 1: return "lbu\t%0,%1";
case 2: return "lhu\t%0,%1";
case 4: return "lw\t%0,%1";
case 8: return "ld\t%0,%1";
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (src_code == CONST_INT)
1992-02-06 21:09:50 +01:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Don't use the X format for the operand itself, because that
will give out-of-range numbers for 64-bit hosts and 32-bit
targets. */
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (!TARGET_MIPS16)
return "li\t%0,%1\t\t\t# %X1";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (SMALL_OPERAND_UNSIGNED (INTVAL (src)))
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
return "li\t%0,%1";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (SMALL_OPERAND_UNSIGNED (-INTVAL (src)))
return "#";
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (src_code == HIGH)
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
return TARGET_MIPS16 ? "#" : "lui\t%0,%h1";
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (CONST_GP_P (src))
return "move\t%0,%1";
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
if (mips_symbolic_constant_p (src, SYMBOL_CONTEXT_LEA, &symbol_type)
&& mips_lo_relocs[symbol_type] != 0)
{
/* A signed 16-bit constant formed by applying a relocation
operator to a symbolic address. */
gcc_assert (!mips_split_p[symbol_type]);
return "li\t%0,%R1";
}
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (symbolic_operand (src, VOIDmode))
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
{
gcc_assert (TARGET_MIPS16
? TARGET_MIPS16_TEXT_LOADS
: !TARGET_EXPLICIT_RELOCS);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? "dla\t%0,%1" : "la\t%0,%1";
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
}
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (src_code == REG && FP_REG_P (REGNO (src)))
{
if (dest_code == REG && FP_REG_P (REGNO (dest)))
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
{
if (GET_MODE (dest) == V2SFmode)
return "mov.ps\t%0,%1";
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? "mov.d\t%0,%1" : "mov.s\t%0,%1";
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (dest_code == MEM)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? "sdc1\t%1,%0" : "swc1\t%1,%0";
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
}
if (dest_code == REG && FP_REG_P (REGNO (dest)))
1992-02-06 21:09:50 +01:00
{
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (src_code == MEM)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return dbl_p ? "ldc1\t%0,%1" : "lwc1\t%0,%1";
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
if (dest_code == REG && ALL_COP_REG_P (REGNO (dest)) && src_code == MEM)
{
static char retval[] = "l_c_\t%0,%1";
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
retval[1] = (dbl_p ? 'd' : 'w');
retval[3] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (dest));
return retval;
}
if (dest_code == MEM && src_code == REG && ALL_COP_REG_P (REGNO (src)))
{
static char retval[] = "s_c_\t%1,%0";
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_subword, [...]): Declare. * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. (mips_move_1word, mips_move_2words): Remove declaration. (mips_split_64bit_move_p, mips_split_64bit_move): Declare. (mips_restore_gp): Remove insn argument. * config/mips/mips.h (FP_REG_RTX_P): New macro. * config/mips/mips.c (volatile_buffer): Remove. (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. (mips_move_1word, mips_move_2words): Remove, replacing with... (mips_output_move): ...this new function. (mips_restore_gp): Remove insn argument. Adjust for above changes. (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove handling of floating-point constants. Handle zero CONST_DOUBLE arguments. (mips_annotate_frame_insn): Replace with... (mips_set_frame_expr): ...this, which just takes one argument. (mips_frame_set): Change the register argument to an rtx. (mips_emit_frame_related_store): Use mips_split_64bit_move_p to check whether moves should be split. Use mips_split_64bit_move to split them. Use mips_subword to generate the high and low parts of a paired FPR. Adjust calls to frame_set and mips_set_frame_expr. (mips_expand_prologue): Simplify due to above changes. * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit targets, replacing xisting register-only versions. (UNSPEC_STORE_DF_HIGH): New unspec. (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. (*paradoxical_extendhidi2): Remove. (movdi_internal, movdi_internal2): Use mips_output_move. (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. (movsf_internal1, movsf_internal2): Likewise. (movdf_internal1a): Likewise. Fix length and type of f <- G case. (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. Add m <- G alternative. (load_df_low, load_df_high, store_df_low): New patterns. (movhi_internal): Use @ template instead of calling a function. Remove unnecessary 'z' alternatives. (movqi_internal): Likewise. (exception_receiver): Update call to mips_restore_gp. From-SVN: r66521
2003-05-06 13:23:42 +02:00
retval[1] = (dbl_p ? 'd' : 'w');
retval[3] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (src));
return retval;
}
gcc_unreachable ();
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if CMP1 is a suitable second operand for integer ordering
test CODE. See also the *sCC patterns in mips.md. */
static bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_int_order_operand_ok_p (enum rtx_code code, rtx cmp1)
{
switch (code)
{
case GT:
case GTU:
return reg_or_0_operand (cmp1, VOIDmode);
case GE:
case GEU:
return !TARGET_MIPS16 && cmp1 == const1_rtx;
case LT:
case LTU:
return arith_operand (cmp1, VOIDmode);
case LE:
return sle_operand (cmp1, VOIDmode);
case LEU:
return sleu_operand (cmp1, VOIDmode);
default:
gcc_unreachable ();
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if *CMP1 (of mode MODE) is a valid second operand for
integer ordering test *CODE, or if an equivalent combination can
be formed by adjusting *CODE and *CMP1. When returning true, update
*CODE and *CMP1 with the chosen code and operand, otherwise leave
them alone. */
static bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_canonicalize_int_order_test (enum rtx_code *code, rtx *cmp1,
enum machine_mode mode)
{
HOST_WIDE_INT plus_one;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (mips_int_order_operand_ok_p (*code, *cmp1))
return true;
if (GET_CODE (*cmp1) == CONST_INT)
switch (*code)
{
case LE:
plus_one = trunc_int_for_mode (UINTVAL (*cmp1) + 1, mode);
if (INTVAL (*cmp1) < plus_one)
{
*code = LT;
*cmp1 = force_reg (mode, GEN_INT (plus_one));
return true;
}
break;
case LEU:
plus_one = trunc_int_for_mode (UINTVAL (*cmp1) + 1, mode);
if (plus_one != 0)
{
*code = LTU;
*cmp1 = force_reg (mode, GEN_INT (plus_one));
return true;
}
break;
default:
break;
}
return false;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Compare CMP0 and CMP1 using ordering test CODE and store the result
in TARGET. CMP0 and TARGET are register_operands. If INVERT_PTR
is nonnull, it's OK to set TARGET to the inverse of the result and
flip *INVERT_PTR instead. */
static void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_emit_int_order_test (enum rtx_code code, bool *invert_ptr,
rtx target, rtx cmp0, rtx cmp1)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
enum machine_mode mode;
/* First see if there is a MIPS instruction that can do this operation.
If not, try doing the same for the inverse operation. If that also
fails, force CMP1 into a register and try again. */
mode = GET_MODE (cmp0);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (mips_canonicalize_int_order_test (&code, &cmp1, mode))
mips_emit_binary (code, target, cmp0, cmp1);
else
{
enum rtx_code inv_code = reverse_condition (code);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!mips_canonicalize_int_order_test (&inv_code, &cmp1, mode))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
cmp1 = force_reg (mode, cmp1);
mips_emit_int_order_test (code, invert_ptr, target, cmp0, cmp1);
}
else if (invert_ptr == 0)
{
rtx inv_target;
inv_target = mips_force_binary (GET_MODE (target),
inv_code, cmp0, cmp1);
mips_emit_binary (XOR, target, inv_target, const1_rtx);
}
else
{
*invert_ptr = !*invert_ptr;
mips_emit_binary (inv_code, target, cmp0, cmp1);
}
}
}
/* Return a register that is zero iff CMP0 and CMP1 are equal.
The register will have the same mode as CMP0. */
static rtx
mips_zero_if_equal (rtx cmp0, rtx cmp1)
{
if (cmp1 == const0_rtx)
return cmp0;
if (uns_arith_operand (cmp1, VOIDmode))
return expand_binop (GET_MODE (cmp0), xor_optab,
cmp0, cmp1, 0, 0, OPTAB_DIRECT);
return expand_binop (GET_MODE (cmp0), sub_optab,
cmp0, cmp1, 0, 0, OPTAB_DIRECT);
}
/* Convert *CODE into a code that can be used in a floating-point
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
scc instruction (C.cond.fmt). Return true if the values of
the condition code registers will be inverted, with 0 indicating
that the condition holds. */
static bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_reversed_fp_cond (enum rtx_code *code)
{
switch (*code)
{
case NE:
case LTGT:
case ORDERED:
*code = reverse_condition_maybe_unordered (*code);
return true;
default:
return false;
}
}
/* Convert a comparison into something that can be used in a branch or
conditional move. cmp_operands[0] and cmp_operands[1] are the values
being compared and *CODE is the code used to compare them.
Update *CODE, *OP0 and *OP1 so that they describe the final comparison.
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
If NEED_EQ_NE_P, then only EQ or NE comparisons against zero are possible,
otherwise any standard branch condition can be used. The standard branch
conditions are:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
- EQ or NE between two registers.
- any comparison between a register and zero. */
static void
mips_emit_compare (enum rtx_code *code, rtx *op0, rtx *op1, bool need_eq_ne_p)
{
if (GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_INT)
{
if (!need_eq_ne_p && cmp_operands[1] == const0_rtx)
{
*op0 = cmp_operands[0];
*op1 = cmp_operands[1];
}
else if (*code == EQ || *code == NE)
{
if (need_eq_ne_p)
{
*op0 = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]);
*op1 = const0_rtx;
}
else
{
*op0 = cmp_operands[0];
*op1 = force_reg (GET_MODE (*op0), cmp_operands[1]);
}
}
else
{
/* The comparison needs a separate scc instruction. Store the
result of the scc in *OP0 and compare it against zero. */
bool invert = false;
*op0 = gen_reg_rtx (GET_MODE (cmp_operands[0]));
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_emit_int_order_test (*code, &invert, *op0,
cmp_operands[0], cmp_operands[1]);
*code = (invert ? EQ : NE);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
*op1 = const0_rtx;
}
}
else if (ALL_FIXED_POINT_MODE_P (GET_MODE (cmp_operands[0])))
{
*op0 = gen_rtx_REG (CCDSPmode, CCDSP_CC_REGNUM);
mips_emit_binary (*code, *op0, cmp_operands[0], cmp_operands[1]);
*code = NE;
*op1 = const0_rtx;
}
else
{
enum rtx_code cmp_code;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Floating-point tests use a separate C.cond.fmt comparison to
set a condition code register. The branch or conditional move
will then compare that register against zero.
Set CMP_CODE to the code of the comparison instruction and
*CODE to the code that the branch or move should use. */
cmp_code = *code;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
*code = mips_reversed_fp_cond (&cmp_code) ? EQ : NE;
*op0 = (ISA_HAS_8CC
? gen_reg_rtx (CCmode)
: gen_rtx_REG (CCmode, FPSW_REGNUM));
*op1 = const0_rtx;
mips_emit_binary (cmp_code, *op0, cmp_operands[0], cmp_operands[1]);
}
}
/* Try comparing cmp_operands[0] and cmp_operands[1] using rtl code CODE.
Store the result in TARGET and return true if successful.
On 64-bit targets, TARGET may be narrower than cmp_operands[0]. */
bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_scc (enum rtx_code code, rtx target)
{
if (GET_MODE_CLASS (GET_MODE (cmp_operands[0])) != MODE_INT)
return false;
if (code == EQ || code == NE)
{
rtx zie = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]);
mips_emit_binary (code, target, zie, const0_rtx);
}
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_emit_int_order_test (code, 0, target,
cmp_operands[0], cmp_operands[1]);
return true;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Compare cmp_operands[0] with cmp_operands[1] using comparison code
CODE and jump to OPERANDS[0] if the condition holds. */
1992-02-06 21:09:50 +01:00
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_conditional_branch (rtx *operands, enum rtx_code code)
1992-02-06 21:09:50 +01:00
{
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
rtx op0, op1, condition;
mips_emit_compare (&code, &op0, &op1, TARGET_MIPS16);
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
condition = gen_rtx_fmt_ee (code, VOIDmode, op0, op1);
emit_jump_insn (gen_condjump (condition, operands[0]));
}
/* Implement:
(set temp (COND:CCV2 CMP_OP0 CMP_OP1))
(set DEST (unspec [TRUE_SRC FALSE_SRC temp] UNSPEC_MOVE_TF_PS)) */
void
mips_expand_vcondv2sf (rtx dest, rtx true_src, rtx false_src,
enum rtx_code cond, rtx cmp_op0, rtx cmp_op1)
{
rtx cmp_result;
bool reversed_p;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
reversed_p = mips_reversed_fp_cond (&cond);
cmp_result = gen_reg_rtx (CCV2mode);
emit_insn (gen_scc_ps (cmp_result,
gen_rtx_fmt_ee (cond, VOIDmode, cmp_op0, cmp_op1)));
if (reversed_p)
emit_insn (gen_mips_cond_move_tf_ps (dest, false_src, true_src,
cmp_result));
else
emit_insn (gen_mips_cond_move_tf_ps (dest, true_src, false_src,
cmp_result));
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Compare cmp_operands[0] with cmp_operands[1] using the code of
OPERANDS[1]. Move OPERANDS[2] into OPERANDS[0] if the condition
holds, otherwise move OPERANDS[3] into OPERANDS[0]. */
1992-02-06 21:09:50 +01:00
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_conditional_move (rtx *operands)
{
enum rtx_code code;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
rtx cond, op0, op1;
code = GET_CODE (operands[1]);
mips_emit_compare (&code, &op0, &op1, true);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
cond = gen_rtx_fmt_ee (code, GET_MODE (op0), op0, op1),
emit_insn (gen_rtx_SET (VOIDmode, operands[0],
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
gen_rtx_IF_THEN_ELSE (GET_MODE (operands[0]), cond,
operands[2], operands[3])));
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Compare cmp_operands[0] with cmp_operands[1] using rtl code CODE,
then trap if the condition holds. */
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_conditional_trap (enum rtx_code code)
{
rtx op0, op1;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
enum machine_mode mode;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* MIPS conditional trap instructions don't have GT or LE flavors,
so we must swap the operands and convert to LT and GE respectively. */
switch (code)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
case GT:
case LE:
case GTU:
case LEU:
code = swap_condition (code);
op0 = cmp_operands[1];
op1 = cmp_operands[0];
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
break;
default:
op0 = cmp_operands[0];
op1 = cmp_operands[1];
break;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mode = GET_MODE (cmp_operands[0]);
op0 = force_reg (mode, op0);
if (!arith_operand (op1, mode))
op1 = force_reg (mode, op1);
emit_insn (gen_rtx_TRAP_IF (VOIDmode,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
gen_rtx_fmt_ee (code, mode, op0, op1),
const0_rtx));
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Initialize *CUM for a call to a function of type FNTYPE. */
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype)
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
memset (cum, 0, sizeof (*cum));
cum->prototype = (fntype && prototype_p (fntype));
cum->gp_reg_found = (cum->prototype && stdarg_p (fntype));
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
}
/* Fill INFO with information about a single argument. CUM is the
cumulative state for earlier arguments. MODE is the mode of this
argument and TYPE is its type (if known). NAMED is true if this
is a named (fixed) argument rather than a variable one. */
static void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_get_arg_info (struct mips_arg_info *info, const CUMULATIVE_ARGS *cum,
enum machine_mode mode, tree type, int named)
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
{
bool doubleword_aligned_p;
unsigned int num_bytes, num_words, max_regs;
mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... gcc/ * config/mips/mips-protos.h (SYMBOL_GOT_LOCAL): Rename to... (SYMBOL_GOT_PAGE_OFST): ...this. (SYMBOL_GOT_GLOBAL): Rename to... (SYMBOL_GOT_DISP): ...this. (SYMBOL_GOTOFF_GLOBAL): Rename to... (SYMBOL_GOTOFF_DISP): ...this. Update comments accordingly. * config/mips/mips.c (mips_global_symbol_p): New function. (mips_symbol_binds_local_p): Likewise. (mips_classify_symbol): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP and SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST. Use mips_global_symbol_p and mips_symbol_binds_local_p. (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) (override_options): Rename SYMBOL_GOT_GLOBAL to SYMBOL_GOT_DISP, SYMBOL_GOT_LOCAL to SYMBOL_GOT_PAGE_OFST and SYMBOL_GOTOFF_GLOBAL to SYMBOL_GOTOFF_DISP. (mips_ok_for_lazy_binding_p): New function. (mips_load_call_address, mips_expand_call): Use it. (mips_dangerous_for_la25_p): Likewise. * config/mips/mips.md (*xgot_hi<mode>, *xgot_lo<mode>) (*got_disp<mode>): Use got_disp_operand instead of global_got_operand. Use SYMBOL_GOTOFF_DISP instead of SYMBOL_GOTOFF_GLOBAL. (*got_page<mode>): Use got_page_ofst_operand instead of local_got_operand. * config/mips/predicates.md (const_call_insn_operand): Use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (global_got_operand): Rename to... (got_disp_operand): ...this and use SYMBOL_GOT_DISP instead of SYMBOL_GOT_GLOBAL. (local_got_operand): Rename to... (got_page_ofst_operand): ...this and use SYMBOL_GOT_PAGE_OFST instead of SYMBOL_GOT_LOCAL. From-SVN: r123752
2007-04-12 19:26:45 +02:00
/* Work out the size of the argument. */
num_bytes = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
num_words = (num_bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
/* Decide whether it should go in a floating-point register, assuming
one is free. Later code checks for availability.
The checks against UNITS_PER_FPVALUE handle the soft-float and
single-float cases. */
switch (mips_abi)
{
case ABI_EABI:
/* The EABI conventions have traditionally been defined in terms
of TYPE_MODE, regardless of the actual type. */
info->fpr_p = ((GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
&& GET_MODE_SIZE (mode) <= UNITS_PER_FPVALUE);
break;
case ABI_32:
case ABI_O64:
/* Only leading floating-point scalars are passed in
floating-point registers. We also handle vector floats the same
say, which is OK because they are not covered by the standard ABI. */
info->fpr_p = (!cum->gp_reg_found
&& cum->arg_number < 2
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& (type == 0
|| SCALAR_FLOAT_TYPE_P (type)
|| VECTOR_FLOAT_TYPE_P (type))
&& (GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
&& GET_MODE_SIZE (mode) <= UNITS_PER_FPVALUE);
break;
case ABI_N32:
case ABI_64:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Scalar, complex and vector floating-point types are passed in
floating-point registers, as long as this is a named rather
than a variable argument. */
info->fpr_p = (named
&& (type == 0 || FLOAT_TYPE_P (type))
&& (GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
|| GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
&& GET_MODE_UNIT_SIZE (mode) <= UNITS_PER_FPVALUE);
/* ??? According to the ABI documentation, the real and imaginary
parts of complex floats should be passed in individual registers.
The real and imaginary parts of stack arguments are supposed
to be contiguous and there should be an extra word of padding
at the end.
This has two problems. First, it makes it impossible to use a
single "void *" va_list type, since register and stack arguments
are passed differently. (At the time of writing, MIPSpro cannot
handle complex float varargs correctly.) Second, it's unclear
what should happen when there is only one register free.
For now, we assume that named complex floats should go into FPRs
if there are two FPRs free, otherwise they should be passed in the
same way as a struct containing two floats. */
if (info->fpr_p
&& GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
&& GET_MODE_UNIT_SIZE (mode) < UNITS_PER_FPVALUE)
{
if (cum->num_gprs >= MAX_ARGS_IN_REGISTERS - 1)
info->fpr_p = false;
else
num_words = 2;
}
break;
default:
gcc_unreachable ();
}
/* See whether the argument has doubleword alignment. */
doubleword_aligned_p = FUNCTION_ARG_BOUNDARY (mode, type) > BITS_PER_WORD;
/* Set REG_OFFSET to the register count we're interested in.
The EABI allocates the floating-point registers separately,
but the other ABIs allocate them like integer registers. */
info->reg_offset = (mips_abi == ABI_EABI && info->fpr_p
? cum->num_fprs
: cum->num_gprs);
/* Advance to an even register if the argument is doubleword-aligned. */
if (doubleword_aligned_p)
info->reg_offset += info->reg_offset & 1;
/* Work out the offset of a stack argument. */
info->stack_offset = cum->stack_words;
if (doubleword_aligned_p)
info->stack_offset += info->stack_offset & 1;
max_regs = MAX_ARGS_IN_REGISTERS - info->reg_offset;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
/* Partition the argument between registers and stack. */
info->reg_words = MIN (num_words, max_regs);
info->stack_words = num_words - info->reg_words;
}
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* INFO describes a register argument that has the normal format for the
argument's mode. Return the register it uses, assuming that FPRs are
available if HARD_FLOAT_P. */
static unsigned int
mips_arg_regno (const struct mips_arg_info *info, bool hard_float_p)
{
if (!info->fpr_p || !hard_float_p)
return GP_ARG_FIRST + info->reg_offset;
else if (mips_abi == ABI_32 && TARGET_DOUBLE_FLOAT && info->reg_offset > 0)
/* In o32, the second argument is always passed in $f14
for TARGET_DOUBLE_FLOAT, regardless of whether the
first argument was a word or doubleword. */
return FP_ARG_FIRST + 2;
else
return FP_ARG_FIRST + info->reg_offset;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_STRICT_ARGUMENT_NAMING. */
static bool
mips_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
{
return !TARGET_OLDABI;
}
/* Implement FUNCTION_ARG. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
rtx
mips_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int named)
{
struct mips_arg_info info;
/* We will be called with a mode of VOIDmode after the last argument
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
has been seen. Whatever we return will be passed to the call expander.
If we need a MIPS16 fp_code, return a REG with the code stored as
the mode. */
if (mode == VOIDmode)
{
if (TARGET_MIPS16 && cum->fp_code != 0)
return gen_rtx_REG ((enum machine_mode) cum->fp_code, 0);
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return NULL;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_get_arg_info (&info, cum, mode, type, named);
/* Return straight away if the whole argument is passed on the stack. */
if (info.reg_offset == MAX_ARGS_IN_REGISTERS)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return NULL;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The n32 and n64 ABIs say that if any 64-bit chunk of the structure
contains a double in its entirety, then that 64-bit chunk is passed
in a floating-point register. */
if (TARGET_NEWABI
&& TARGET_HARD_FLOAT
&& named
&& type != 0
&& TREE_CODE (type) == RECORD_TYPE
&& TYPE_SIZE_UNIT (type)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& host_integerp (TYPE_SIZE_UNIT (type), 1))
{
tree field;
/* First check to see if there is any such field. */
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
&& host_integerp (bit_position (field), 0)
&& int_bit_position (field) % BITS_PER_WORD == 0)
break;
1992-02-06 21:09:50 +01:00
if (field != 0)
{
/* Now handle the special case by returning a PARALLEL
indicating where each 64-bit chunk goes. INFO.REG_WORDS
chunks are passed in registers. */
unsigned int i;
HOST_WIDE_INT bitpos;
rtx ret;
/* assign_parms checks the mode of ENTRY_PARM, so we must
use the actual mode here. */
ret = gen_rtx_PARALLEL (mode, rtvec_alloc (info.reg_words));
1992-02-06 21:09:50 +01:00
bitpos = 0;
field = TYPE_FIELDS (type);
for (i = 0; i < info.reg_words; i++)
{
rtx reg;
1992-02-06 21:09:50 +01:00
for (; field; field = TREE_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& int_bit_position (field) >= bitpos)
break;
1992-02-06 21:09:50 +01:00
if (field
&& int_bit_position (field) == bitpos
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD)
reg = gen_rtx_REG (DFmode, FP_ARG_FIRST + info.reg_offset + i);
else
reg = gen_rtx_REG (DImode, GP_ARG_FIRST + info.reg_offset + i);
XVECEXP (ret, 0, i)
= gen_rtx_EXPR_LIST (VOIDmode, reg,
GEN_INT (bitpos / BITS_PER_UNIT));
bitpos += BITS_PER_WORD;
}
return ret;
}
}
/* Handle the n32/n64 conventions for passing complex floating-point
arguments in FPR pairs. The real part goes in the lower register
and the imaginary part goes in the upper register. */
if (TARGET_NEWABI
&& info.fpr_p
&& GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
1992-02-06 21:09:50 +01:00
{
rtx real, imag;
enum machine_mode inner;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned int regno;
inner = GET_MODE_INNER (mode);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
regno = FP_ARG_FIRST + info.reg_offset;
if (info.reg_words * UNITS_PER_WORD == GET_MODE_SIZE (inner))
{
/* Real part in registers, imaginary part on stack. */
gcc_assert (info.stack_words == info.reg_words);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return gen_rtx_REG (inner, regno);
}
else
{
gcc_assert (info.stack_words == 0);
real = gen_rtx_EXPR_LIST (VOIDmode,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
gen_rtx_REG (inner, regno),
const0_rtx);
imag = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (inner,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
regno + info.reg_words / 2),
GEN_INT (GET_MODE_SIZE (inner)));
return gen_rtx_PARALLEL (mode, gen_rtvec (2, real, imag));
}
}
return gen_rtx_REG (mode, mips_arg_regno (&info, TARGET_HARD_FLOAT));
1992-02-06 21:09:50 +01:00
}
/* Implement FUNCTION_ARG_ADVANCE. */
1992-02-06 21:09:50 +01:00
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int named)
{
struct mips_arg_info info;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_get_arg_info (&info, cum, mode, type, named);
if (!info.fpr_p)
cum->gp_reg_found = true;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* See the comment above the CUMULATIVE_ARGS structure in mips.h for
an explanation of what this code does. It assumes that we're using
either the o32 or the o64 ABI, both of which pass at most 2 arguments
in FPRs. */
if (cum->arg_number < 2 && info.fpr_p)
cum->fp_code += (mode == SFmode ? 1 : 2) << (cum->arg_number * 2);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Advance the register count. This has the effect of setting
num_gprs to MAX_ARGS_IN_REGISTERS if a doubleword-aligned
argument required us to skip the final GPR and pass the whole
argument on the stack. */
if (mips_abi != ABI_EABI || !info.fpr_p)
cum->num_gprs = info.reg_offset + info.reg_words;
else if (info.reg_words > 0)
cum->num_fprs += MAX_FPRS_PER_FMT;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Advance the stack word count. */
if (info.stack_words > 0)
cum->stack_words = info.stack_offset + info.stack_words;
cum->arg_number++;
}
/* Implement TARGET_ARG_PARTIAL_BYTES. */
static int
mips_arg_partial_bytes (CUMULATIVE_ARGS *cum,
enum machine_mode mode, tree type, bool named)
{
struct mips_arg_info info;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_get_arg_info (&info, cum, mode, type, named);
return info.stack_words > 0 ? info.reg_words * UNITS_PER_WORD : 0;
}
(dfhigh, dflow, sfhigh, sflow): New variables. (mips_sw_reg_names): Consistently use $ as name prefix. (large_int): Handle 64 bit constants. (reg_or_0_operand, mips_const_double_ok): Don't examine CONST_DOUBLE internals. (mips_const_double_ok): Use REAL_VALUE_* macros. (simple_memory_operand): Add 64 bit support. Only test TARGET_GP_OPT to determine if doing gp optimizations. Pass address not MEM to eliminate_constant_term. Use SMALL_INT. (mips_fill_delay_slot): Add 64 bit support. (mips_move_1word): Add 64 bit support. Don't examine CONST_DOUBLE internals. (mips_move_2words): Likewise. (mips_address_cost): Pass address not MEM to eliminate_constant_term. Use SMALL_INT. (gen_int_relational): New variable mode. Add 64 bit support. (gen_conditional_branch): Add 64 bit support. (block_move_load_store, block_move_loop, block_move_call, expand_block_move, output_block_move, function_arg_advance, function_arg, function_arg_partial_nregs): Likewise. (override_options): Clear MASK_GPOPT if threshold is zero or negative. Set MASK_GPOPT if optimizing. Set mips_isa from -misa= option, else from MIPS_ISA_DEFAULT if defined, else to 1. Make default cpu depend on isa. Add cpus r4400, r4600, orion. Rewrite TARGET_NAME_REGS support. Initialize dfhigh, dflow, sfhigh, sflow. Add 64 bit support. (print_operand): Use REAL_VALUE_* macros. (mips_output_external): Don't depend on mips_section_threshold. (make_temp_file): Define P_tmpdir when __MSDOS__. Malloc filename string. Don't unlink temp file when __MSDOS__. (mips_asm_file_start): Delete TARGET_NAME_REGS support. (mips_asm_file_end): Unlike temp file when __MSDOS__. (mips_declare_object): Don't test mips_sections_threshold. (compute_frame_size, save_restore_insns, function_prologue, mips_expand_prologue, function_epilogue, mips_expand_epilogue): Add 64 bit support. (function_epilogue): Correctly output `#' before .set volatile. From-SVN: r6391
1994-01-14 00:51:01 +01:00
/* Implement FUNCTION_ARG_BOUNDARY. Every parameter gets at least
PARM_BOUNDARY bits of alignment, but will be given anything up
to STACK_BOUNDARY bits if the type requires it. */
int
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_function_arg_boundary (enum machine_mode mode, tree type)
{
unsigned int alignment;
alignment = type ? TYPE_ALIGN (type) : GET_MODE_ALIGNMENT (mode);
if (alignment < PARM_BOUNDARY)
alignment = PARM_BOUNDARY;
if (alignment > STACK_BOUNDARY)
alignment = STACK_BOUNDARY;
return alignment;
}
/* Return true if FUNCTION_ARG_PADDING (MODE, TYPE) should return
upward rather than downward. In other words, return true if the
first byte of the stack slot has useful data, false if the last
byte does. */
bool
mips_pad_arg_upward (enum machine_mode mode, const_tree type)
{
/* On little-endian targets, the first byte of every stack argument
is passed in the first byte of the stack slot. */
if (!BYTES_BIG_ENDIAN)
return true;
/* Otherwise, integral types are padded downward: the last byte of a
stack argument is passed in the last byte of the stack slot. */
if (type != 0
? (INTEGRAL_TYPE_P (type)
|| POINTER_TYPE_P (type)
|| FIXED_POINT_TYPE_P (type))
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
: (SCALAR_INT_MODE_P (mode)
|| ALL_SCALAR_FIXED_POINT_MODE_P (mode)))
return false;
/* Big-endian o64 pads floating-point arguments downward. */
if (mips_abi == ABI_O64)
if (type != 0 ? FLOAT_TYPE_P (type) : GET_MODE_CLASS (mode) == MODE_FLOAT)
return false;
/* Other types are padded upward for o32, o64, n32 and n64. */
if (mips_abi != ABI_EABI)
return true;
/* Arguments smaller than a stack slot are padded downward. */
if (mode != BLKmode)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return GET_MODE_BITSIZE (mode) >= PARM_BOUNDARY;
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return int_size_in_bytes (type) >= (PARM_BOUNDARY / BITS_PER_UNIT);
}
/* Likewise BLOCK_REG_PADDING (MODE, TYPE, ...). Return !BYTES_BIG_ENDIAN
if the least significant byte of the register has useful data. Return
the opposite if the most significant byte does. */
bool
mips_pad_reg_upward (enum machine_mode mode, tree type)
{
/* No shifting is required for floating-point arguments. */
if (type != 0 ? FLOAT_TYPE_P (type) : GET_MODE_CLASS (mode) == MODE_FLOAT)
return !BYTES_BIG_ENDIAN;
/* Otherwise, apply the same padding to register arguments as we do
to stack arguments. */
return mips_pad_arg_upward (mode, type);
}
1992-02-06 21:09:50 +01:00
/* Return nonzero when an argument must be passed by reference. */
1992-02-06 21:09:50 +01:00
static bool
mips_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
enum machine_mode mode, const_tree type,
bool named ATTRIBUTE_UNUSED)
{
if (mips_abi == ABI_EABI)
{
int size;
1992-02-06 21:09:50 +01:00
/* ??? How should SCmode be handled? */
if (mode == DImode || mode == DFmode
|| mode == DQmode || mode == UDQmode
|| mode == DAmode || mode == UDAmode)
return 0;
1992-02-06 21:09:50 +01:00
size = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
return size == -1 || size > UNITS_PER_WORD;
}
else
1992-02-06 21:09:50 +01:00
{
/* If we have a variable-sized parameter, we have no choice. */
return targetm.calls.must_pass_in_stack (mode, type);
1992-02-06 21:09:50 +01:00
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_CALLEE_COPIES. */
static bool
mips_callee_copies (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED,
const_tree type ATTRIBUTE_UNUSED, bool named)
{
return mips_abi == ABI_EABI && named;
}
/* See whether VALTYPE is a record whose fields should be returned in
floating-point registers. If so, return the number of fields and
list them in FIELDS (which should have two elements). Return 0
otherwise.
For n32 & n64, a structure with one or two fields is returned in
floating-point registers as long as every field has a floating-point
type. */
static int
mips_fpr_return_fields (const_tree valtype, tree *fields)
2002-03-22 10:55:03 +01:00
{
tree field;
int i;
2002-03-22 10:55:03 +01:00
if (!TARGET_NEWABI)
return 0;
2002-03-22 10:55:03 +01:00
if (TREE_CODE (valtype) != RECORD_TYPE)
return 0;
2002-03-22 10:55:03 +01:00
i = 0;
for (field = TYPE_FIELDS (valtype); field != 0; field = TREE_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
if (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (field)))
return 0;
if (i == 2)
return 0;
fields[i++] = field;
}
return i;
}
/* Implement TARGET_RETURN_IN_MSB. For n32 & n64, we should return
a value in the most significant part of $2/$3 if:
- the target is big-endian;
- the value has a structure or union type (we generalize this to
cover aggregates from other languages too); and
2002-03-22 10:55:03 +01:00
- the structure is not returned in floating-point registers. */
2002-03-22 10:55:03 +01:00
static bool
mips_return_in_msb (const_tree valtype)
{
tree fields[2];
2002-03-22 10:55:03 +01:00
return (TARGET_NEWABI
&& TARGET_BIG_ENDIAN
&& AGGREGATE_TYPE_P (valtype)
&& mips_fpr_return_fields (valtype, fields) == 0);
2002-03-22 10:55:03 +01:00
}
/* Return true if the function return value MODE will get returned in a
floating-point register. */
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
static bool
mips_return_mode_in_fpr_p (enum machine_mode mode)
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
{
return ((GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
&& GET_MODE_UNIT_SIZE (mode) <= UNITS_PER_HWFPVALUE);
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
}
/* Return the representation of an FPR return register when the
value being returned in FP_RETURN has mode VALUE_MODE and the
return type itself has mode TYPE_MODE. On NewABI targets,
the two modes may be different for structures like:
struct __attribute__((packed)) foo { float f; }
where we return the SFmode value of "f" in FP_RETURN, but where
the structure itself has mode BLKmode. */
static rtx
mips_return_fpr_single (enum machine_mode type_mode,
enum machine_mode value_mode)
{
rtx x;
x = gen_rtx_REG (value_mode, FP_RETURN);
if (type_mode != value_mode)
{
x = gen_rtx_EXPR_LIST (VOIDmode, x, const0_rtx);
x = gen_rtx_PARALLEL (type_mode, gen_rtvec (1, x));
}
return x;
}
/* Return a composite value in a pair of floating-point registers.
MODE1 and OFFSET1 are the mode and byte offset for the first value,
likewise MODE2 and OFFSET2 for the second. MODE is the mode of the
complete value.
1992-02-06 21:09:50 +01:00
For n32 & n64, $f0 always holds the first value and $f2 the second.
Otherwise the values are packed together as closely as possible. */
1992-02-06 21:09:50 +01:00
static rtx
mips_return_fpr_pair (enum machine_mode mode,
enum machine_mode mode1, HOST_WIDE_INT offset1,
enum machine_mode mode2, HOST_WIDE_INT offset2)
{
int inc;
1992-02-06 21:09:50 +01:00
inc = (TARGET_NEWABI ? 2 : MAX_FPRS_PER_FMT);
return gen_rtx_PARALLEL
(mode,
gen_rtvec (2,
gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (mode1, FP_RETURN),
GEN_INT (offset1)),
gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (mode2, FP_RETURN + inc),
GEN_INT (offset2))));
1992-02-06 21:09:50 +01:00
}
/* Implement FUNCTION_VALUE and LIBCALL_VALUE. For normal calls,
VALTYPE is the return type and MODE is VOIDmode. For libcalls,
VALTYPE is null and MODE is the mode of the return value. */
1992-02-06 21:09:50 +01:00
rtx
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_function_value (const_tree valtype, enum machine_mode mode)
{
if (valtype)
1992-02-06 21:09:50 +01:00
{
tree fields[2];
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
int unsigned_p;
1992-02-06 21:09:50 +01:00
mode = TYPE_MODE (valtype);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned_p = TYPE_UNSIGNED (valtype);
2002-03-22 10:55:03 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Since TARGET_PROMOTE_FUNCTION_RETURN unconditionally returns true,
we must promote the mode just as PROMOTE_MODE does. */
mode = promote_mode (valtype, mode, &unsigned_p, 1);
mips.md: Add unspec #2. 2001-09-15 Eric Christopher <echristo@redhat.com> * config/mips/mips.md: Add unspec #2. (reload_indi): Use. (reload_outdi): Ditto. (reload_outsi): Ditto. (HILO_delay): New. 2001-09-15 Eric Christopher <echristo@redhat.com> Jason Eckhardt <jle@redhat.com> * config.gcc: Add mipsisa32 target and mipsisa32-linux target. * config/mips/isa32-linux.h: New file. * config/mips/isa3264.h: Ditto. * config/mips/mips-protos.h: Add mips_hard_regno_nregs. * config/mips/mips.c (mips_hard_regno_nregs): Move here from mips.h. (output_block_mode): Support MEABI. (function_arg): Ditto. Fix floating point arg passing. (mips_va_start): Ditto. (override_options): Add isas 32 and 64, meabi, mips32 and mips64 processors. (mips_asm_file_start): Add new section to pass abi to gdb. (function_arg_pass_by_reference): Support MEABI. (mips_parse_cpu): Support mips32 and mips64 processors. * config/mips/mips.h: Support ABI_MEABI, TARGET_MIPS4KC, TARGET_MIPS5KC. Support isa32 and isa64. (processor_type): Add r4kc, r5kc, r20kc. (GENERATE_MULT3_SI): New. (GENERATE_MULT3_DI): Ditto. (GENERATE_MULT3): Remove. (ISA_HAS_64BIT_REGS): Add isa == 64. (ISA_HAS_8CC): Add mips_isa = 32 and 64. (ISA_HAS_MADD_MSUB): New. (ISA_HAS_CLZ_CLO): Ditto. (ISA_HAS_DCLZ_DCLO): Ditto. (ABI_GAS_ASM_SPEC): New. (GAS_ASM_SPEC): Use. Add support for mips32, mips64. (ASM_SPEC): Ditto. (LINK_SPEC): Ditto. (SUBTARGET_CC1_SPEC): Ditto. (SUBTARGET_CPP_SIZE_SPEC): Ditto. (PAD_VARARGS_DOWN): Support MEABI. (HARD_REGNO_NREGS): Move to mips.c. (ASM_OUTPUT_IDENT): Add #undef. * config/mips/mips.md: Add r4kc, r5kc, r20kc. (mulsi3): Use GENERATE_MULT3_SI. (mulsi3_mult3): Ditto. Support mips32, mips64. (mul_acc_si): Use ISA_HAS_MADD_MSUB. (mul_sub_si): New pattern. (unnamed splitters): New. (muldi3): Use GENERATE_MULT3_DI. (muldi3_internal2): Ditto. (movdicc): Support mips32. * config/mips/t-isa3264: New file. From-SVN: r45623
2001-09-15 04:03:14 +02:00
/* Handle structures whose fields are returned in $f0/$f2. */
switch (mips_fpr_return_fields (valtype, fields))
{
case 1:
return mips_return_fpr_single (mode,
TYPE_MODE (TREE_TYPE (fields[0])));
2002-03-22 10:55:03 +01:00
case 2:
return mips_return_fpr_pair (mode,
TYPE_MODE (TREE_TYPE (fields[0])),
int_byte_position (fields[0]),
TYPE_MODE (TREE_TYPE (fields[1])),
int_byte_position (fields[1]));
}
2002-03-22 10:55:03 +01:00
/* If a value is passed in the most significant part of a register, see
whether we have to round the mode up to a whole number of words. */
if (mips_return_in_msb (valtype))
{
HOST_WIDE_INT size = int_size_in_bytes (valtype);
if (size % UNITS_PER_WORD != 0)
{
size += UNITS_PER_WORD - size % UNITS_PER_WORD;
mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
2002-03-22 10:55:03 +01:00
}
}
/* For EABI, the class of return register depends entirely on MODE.
For example, "struct { some_type x; }" and "union { some_type x; }"
are returned in the same way as a bare "some_type" would be.
Other ABIs only use FPRs for scalar, complex or vector types. */
if (mips_abi != ABI_EABI && !FLOAT_TYPE_P (valtype))
return gen_rtx_REG (mode, GP_RETURN);
}
if (!TARGET_MIPS16)
{
/* Handle long doubles for n32 & n64. */
if (mode == TFmode)
return mips_return_fpr_pair (mode,
DImode, 0,
DImode, GET_MODE_SIZE (mode) / 2);
if (mips_return_mode_in_fpr_p (mode))
{
if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
return mips_return_fpr_pair (mode,
GET_MODE_INNER (mode), 0,
GET_MODE_INNER (mode),
GET_MODE_SIZE (mode) / 2);
else
return gen_rtx_REG (mode, FP_RETURN);
}
}
return gen_rtx_REG (mode, GP_RETURN);
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_RETURN_IN_MEMORY. Under the o32 and o64 ABIs,
all BLKmode objects are returned in memory. Under the n32, n64
and embedded ABIs, small structures are returned in a register.
Objects with varying size must still be returned in memory, of
course. */
static bool
mips_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return (TARGET_OLDABI
? TYPE_MODE (type) == BLKmode
: !IN_RANGE (int_size_in_bytes (type), 0, 2 * UNITS_PER_WORD));
}
2002-03-22 10:55:03 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_SETUP_INCOMING_VARARGS. */
static void
mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int *pretend_size ATTRIBUTE_UNUSED,
int no_rtl)
2002-03-22 10:55:03 +01:00
{
CUMULATIVE_ARGS local_cum;
int gp_saved, fp_saved;
1992-02-06 21:09:50 +01:00
2002-03-22 10:55:03 +01:00
/* The caller has advanced CUM up to, but not beyond, the last named
argument. Advance a local copy of CUM past the last "real" named
varargs.h: Replace with stub which issues #error. * ginclude/varargs.h: Replace with stub which issues #error. * ginclude/stdarg.h: __builtin_stdarg_start is renamed __builtin_va_start. * builtins.def (BUILT_IN_VARARGS_START): Delete. (BUILT_IN_VA_START): New. * builtins.c (expand_builtin_va_start): Eliminate first argument and code to implement pre-ISO varargs. (std_expand_builtin_va_start): Ignore first argument; it is always 1. (expand_builtin): Handle BUILT_IN_VA_START and BUILT_IN_STDARG_START identically. Delete BUILT_IN_VARARGS_START case. * function.c (assign_parms): Delete hide_last_arg and all its uses. (mark_varargs): Delete function. * function.h (struct function): Delete 'varargs' bit. (current_function_varargs): Delete macro. * tree.h: Don't declare mark_varargs. * c-decl.c (c_function_varargs, c_mark_varargs): Delete. (c_expand_body): Don't call mark_varargs. * c-objc-common.c: Handle BUILT_IN_VA_START and BUILT_IN_STDARG_START identically. Delete BUILT_IN_VARARGS_START case. * c-tree.h: Don't declare c_mark_varargs. * c-parse.in: Remove grammar rules for '&...' (which has been commented out since before 2.7.2) and for '...' in K+R argument declarations. * builtins.c, function.c, integrate.c, sibcall.c, config/alpha/unicosmk.h, config/arc/arc.c, config/arc/arc.h, config/avr/avr.c, config/cris/cris.c, config/fr30/fr30.c, config/i960/i960.c, config/i960/i960.md, config/m32r/m32r.c, config/m32r/m32r.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, config/mn10300/mn10300.c, config/pa/som.h, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.c: Delete all references to current_function_varargs, and code predicated on that flag. * config/alpha/alpha.c (alpha_va_start), config/arc/arc.c (arc_va_start), config/i386/i386.c (ix86_va_start), config/mips/mips.c (mips_va_start), config/mn10300/mn10300.c (mn10300_va_start), config/rs6000/rs6000.c (rs6000_va_start), config/s390/s390.c (s390_va_start), config/sh/sh.c (sh_va_start), Ignore first argument; it is always 1. * config/c4x/c4x-protos.h, config/c4x/c4x.c: Delete c4x_va_start. * config/ia64/ia64-protos.h, config/ia64/ia64.c: Delete ia64_va_start. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c: Delete m68hc11_va_start. * config/c4x/c4x.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h: No need to define EXPAND_BUILTIN_VA_START. * doc/invoke.texi, doc/sourcebuild.texi, doc/tm.texi, doc/trouble.texi: Remove references to GCC-provided <varargs.h>. testsuite: * c-torture/execute/991216-3.c, c-torture/execute/strct-varg-1.c, c-torture/execute/va-arg-7.c, c-torture/execute/va-arg-8.c, c-torture/execute/va-arg-15.c, c-torture/execute/va-arg-16.c, c-torture/execute/va-arg-17.c, c-torture/execute/va-arg-19.c: Convert to use <stdarg.h>. * c-torture/execute/va-arg-3.c, c-torture/execute/va-arg-3.x: Delete. * gcc.dg/va-arg-2.c: New. * lib/gcc.exp, lib/objc.exp: Remove code to set -DNO_VARARGS. From-SVN: r55472
2002-07-16 04:16:47 +02:00
argument, to find out how many registers are left over. */
2002-03-22 10:55:03 +01:00
local_cum = *cum;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
FUNCTION_ARG_ADVANCE (local_cum, mode, type, true);
2002-03-22 10:55:03 +01:00
/* Found out how many registers we need to save. */
gp_saved = MAX_ARGS_IN_REGISTERS - local_cum.num_gprs;
2002-03-22 10:55:03 +01:00
fp_saved = (EABI_FLOAT_VARARGS_P
? MAX_ARGS_IN_REGISTERS - local_cum.num_fprs
2002-03-22 10:55:03 +01:00
: 0);
1992-02-06 21:09:50 +01:00
2002-03-22 10:55:03 +01:00
if (!no_rtl)
1992-02-06 21:09:50 +01:00
{
2002-03-22 10:55:03 +01:00
if (gp_saved > 0)
{
rtx ptr, mem;
ptr = plus_constant (virtual_incoming_args_rtx,
REG_PARM_STACK_SPACE (cfun->decl)
- gp_saved * UNITS_PER_WORD);
mem = gen_frame_mem (BLKmode, ptr);
set_mem_alias_set (mem, get_varargs_alias_set ());
2002-03-22 10:55:03 +01:00
move_block_from_reg (local_cum.num_gprs + GP_ARG_FIRST,
mem, gp_saved);
2002-03-22 10:55:03 +01:00
}
if (fp_saved > 0)
{
/* We can't use move_block_from_reg, because it will use
the wrong mode. */
2002-03-22 10:55:03 +01:00
enum machine_mode mode;
int off, i;
1992-02-06 21:09:50 +01:00
2002-03-22 10:55:03 +01:00
/* Set OFF to the offset from virtual_incoming_args_rtx of
the first float register. The FP save area lies below
2002-03-22 10:55:03 +01:00
the integer one, and is aligned to UNITS_PER_FPVALUE bytes. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
off = (-gp_saved * UNITS_PER_WORD) & -UNITS_PER_FPVALUE;
2002-03-22 10:55:03 +01:00
off -= fp_saved * UNITS_PER_FPREG;
1992-02-06 21:09:50 +01:00
2002-03-22 10:55:03 +01:00
mode = TARGET_SINGLE_FLOAT ? SFmode : DFmode;
for (i = local_cum.num_fprs; i < MAX_ARGS_IN_REGISTERS;
i += MAX_FPRS_PER_FMT)
2002-03-22 10:55:03 +01:00
{
rtx ptr, mem;
ptr = plus_constant (virtual_incoming_args_rtx, off);
mem = gen_frame_mem (mode, ptr);
set_mem_alias_set (mem, get_varargs_alias_set ());
mips_emit_move (mem, gen_rtx_REG (mode, FP_ARG_FIRST + i));
off += UNITS_PER_HWFPVALUE;
2002-03-22 10:55:03 +01:00
}
}
}
if (REG_PARM_STACK_SPACE (cfun->decl) == 0)
cfun->machine->varargs_size = (gp_saved * UNITS_PER_WORD
+ fp_saved * UNITS_PER_FPREG);
1992-02-06 21:09:50 +01:00
}
2002-03-22 10:55:03 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_BUILTIN_VA_LIST. */
static tree
mips_build_builtin_va_list (void)
{
2002-03-22 10:55:03 +01:00
if (EABI_FLOAT_VARARGS_P)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* We keep 3 pointers, and two offsets.
Two pointers are to the overflow area, which starts at the CFA.
One of these is constant, for addressing into the GPR save area
below it. The other is advanced up the stack through the
overflow region.
The third pointer is to the bottom of the GPR save area.
Since the FPR save area is just below it, we can address
FPR slots off this pointer.
We also keep two one-byte offsets, which are to be subtracted
from the constant pointers to yield addresses in the GPR and
FPR save areas. These are downcounted as float or non-float
arguments are used, and when they get to zero, the argument
must be obtained from the overflow region. */
tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff, f_res, record;
tree array, index;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
record = lang_hooks.types.make_type (RECORD_TYPE);
f_ovfl = build_decl (FIELD_DECL, get_identifier ("__overflow_argptr"),
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
ptr_type_node);
f_gtop = build_decl (FIELD_DECL, get_identifier ("__gpr_top"),
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
ptr_type_node);
f_ftop = build_decl (FIELD_DECL, get_identifier ("__fpr_top"),
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
ptr_type_node);
f_goff = build_decl (FIELD_DECL, get_identifier ("__gpr_offset"),
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned_char_type_node);
f_foff = build_decl (FIELD_DECL, get_identifier ("__fpr_offset"),
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned_char_type_node);
/* Explicitly pad to the size of a pointer, so that -Wpadded won't
warn on every user file. */
tree.h (build_int_cst): New, sign extended constant. * tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-25 11:52:54 +02:00
index = build_int_cst (NULL_TREE, GET_MODE_SIZE (ptr_mode) - 2 - 1);
array = build_array_type (unsigned_char_type_node,
build_index_type (index));
f_res = build_decl (FIELD_DECL, get_identifier ("__reserved"), array);
DECL_FIELD_CONTEXT (f_ovfl) = record;
DECL_FIELD_CONTEXT (f_gtop) = record;
DECL_FIELD_CONTEXT (f_ftop) = record;
DECL_FIELD_CONTEXT (f_goff) = record;
DECL_FIELD_CONTEXT (f_foff) = record;
DECL_FIELD_CONTEXT (f_res) = record;
TYPE_FIELDS (record) = f_ovfl;
TREE_CHAIN (f_ovfl) = f_gtop;
TREE_CHAIN (f_gtop) = f_ftop;
TREE_CHAIN (f_ftop) = f_goff;
TREE_CHAIN (f_goff) = f_foff;
TREE_CHAIN (f_foff) = f_res;
layout_type (record);
return record;
}
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
else if (TARGET_IRIX && TARGET_IRIX6)
/* On IRIX 6, this type is 'char *'. */
return build_pointer_type (char_type_node);
else
/* Otherwise, we use 'void *'. */
return ptr_type_node;
}
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
/* Implement TARGET_EXPAND_BUILTIN_VA_START. */
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
mips_va_start (tree valist, rtx nextarg)
{
if (EABI_FLOAT_VARARGS_P)
{
const CUMULATIVE_ARGS *cum;
tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
tree ovfl, gtop, ftop, goff, foff;
tree t;
int gpr_save_area_size;
int fpr_save_area_size;
int fpr_offset;
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
cum = &crtl->args.info;
2002-03-22 10:55:03 +01:00
gpr_save_area_size
= (MAX_ARGS_IN_REGISTERS - cum->num_gprs) * UNITS_PER_WORD;
fpr_save_area_size
= (MAX_ARGS_IN_REGISTERS - cum->num_fprs) * UNITS_PER_FPREG;
2002-03-22 10:55:03 +01:00
f_ovfl = TYPE_FIELDS (va_list_type_node);
f_gtop = TREE_CHAIN (f_ovfl);
f_ftop = TREE_CHAIN (f_gtop);
f_goff = TREE_CHAIN (f_ftop);
f_foff = TREE_CHAIN (f_goff);
ovfl = build3 (COMPONENT_REF, TREE_TYPE (f_ovfl), valist, f_ovfl,
NULL_TREE);
gtop = build3 (COMPONENT_REF, TREE_TYPE (f_gtop), valist, f_gtop,
NULL_TREE);
ftop = build3 (COMPONENT_REF, TREE_TYPE (f_ftop), valist, f_ftop,
NULL_TREE);
goff = build3 (COMPONENT_REF, TREE_TYPE (f_goff), valist, f_goff,
NULL_TREE);
foff = build3 (COMPONENT_REF, TREE_TYPE (f_foff), valist, f_foff,
NULL_TREE);
/* Emit code to initialize OVFL, which points to the next varargs
stack argument. CUM->STACK_WORDS gives the number of stack
words used by named arguments. */
t = make_tree (TREE_TYPE (ovfl), virtual_incoming_args_rtx);
if (cum->stack_words > 0)
[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
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovfl), t,
size_int (cum->stack_words * UNITS_PER_WORD));
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, TREE_TYPE (ovfl), ovfl, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Emit code to initialize GTOP, the top of the GPR save area. */
t = make_tree (TREE_TYPE (gtop), virtual_incoming_args_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
t = build2 (MODIFY_EXPR, TREE_TYPE (gtop), gtop, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Emit code to initialize FTOP, the top of the FPR save area.
This address is gpr_save_area_bytes below GTOP, rounded
down to the next fp-aligned boundary. */
t = make_tree (TREE_TYPE (ftop), virtual_incoming_args_rtx);
fpr_offset = gpr_save_area_size + UNITS_PER_FPVALUE - 1;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fpr_offset &= -UNITS_PER_FPVALUE;
if (fpr_offset)
[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
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ftop), t,
size_int (-fpr_offset));
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, TREE_TYPE (ftop), ftop, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Emit code to initialize GOFF, the offset from GTOP of the
next GPR argument. */
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, TREE_TYPE (goff), goff,
build_int_cst (TREE_TYPE (goff), gpr_save_area_size));
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Likewise emit code to initialize FOFF, the offset from FTOP
of the next FPR argument. */
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, TREE_TYPE (foff), foff,
build_int_cst (TREE_TYPE (foff), fpr_save_area_size));
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
else
{
nextarg = plus_constant (nextarg, -cfun->machine->varargs_size);
std_expand_builtin_va_start (valist, nextarg);
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_GIMPLIFY_VA_ARG_EXPR. */
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
mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
gimple_seq *post_p)
{
tree addr;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
bool indirect_p;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, 0);
if (indirect_p)
type = build_pointer_type (type);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!EABI_FLOAT_VARARGS_P)
addr = std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
else
{
tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
tree ovfl, top, off, align;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
HOST_WIDE_INT size, rsize, osize;
tree t, u;
f_ovfl = TYPE_FIELDS (va_list_type_node);
f_gtop = TREE_CHAIN (f_ovfl);
f_ftop = TREE_CHAIN (f_gtop);
f_goff = TREE_CHAIN (f_ftop);
f_foff = TREE_CHAIN (f_goff);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Let:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
TOP be the top of the GPR or FPR save area;
OFF be the offset from TOP of the next register;
ADDR_RTX be the address of the argument;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
SIZE be the number of bytes in the argument type;
RSIZE be the number of bytes used to store the argument
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
when it's in the register save area; and
OSIZE be the number of bytes used to store it when it's
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
in the stack overflow area.
The code we want is:
1: off &= -rsize; // round down
2: if (off != 0)
3: {
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
4: addr_rtx = top - off + (BYTES_BIG_ENDIAN ? RSIZE - SIZE : 0);
5: off -= rsize;
6: }
7: else
8: {
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
9: ovfl = ((intptr_t) ovfl + osize - 1) & -osize;
10: addr_rtx = ovfl + (BYTES_BIG_ENDIAN ? OSIZE - SIZE : 0);
11: ovfl += osize;
14: }
[1] and [9] can sometimes be optimized away. */
ovfl = build3 (COMPONENT_REF, TREE_TYPE (f_ovfl), valist, f_ovfl,
NULL_TREE);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
size = int_size_in_bytes (type);
if (GET_MODE_CLASS (TYPE_MODE (type)) == MODE_FLOAT
&& GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_FPVALUE)
{
top = build3 (COMPONENT_REF, TREE_TYPE (f_ftop), valist, f_ftop,
NULL_TREE);
off = build3 (COMPONENT_REF, TREE_TYPE (f_foff), valist, f_foff,
NULL_TREE);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* When va_start saves FPR arguments to the stack, each slot
takes up UNITS_PER_HWFPVALUE bytes, regardless of the
argument's precision. */
rsize = UNITS_PER_HWFPVALUE;
/* Overflow arguments are padded to UNITS_PER_WORD bytes
(= PARM_BOUNDARY bits). This can be different from RSIZE
in two cases:
(1) On 32-bit targets when TYPE is a structure such as:
struct s { float f; };
Such structures are passed in paired FPRs, so RSIZE
will be 8 bytes. However, the structure only takes
up 4 bytes of memory, so OSIZE will only be 4.
(2) In combinations such as -mgp64 -msingle-float
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
-fshort-double. Doubles passed in registers will then take
up 4 (UNITS_PER_HWFPVALUE) bytes, but those passed on the
stack take up UNITS_PER_WORD bytes. */
osize = MAX (GET_MODE_SIZE (TYPE_MODE (type)), UNITS_PER_WORD);
}
2002-03-22 10:55:03 +01:00
else
{
top = build3 (COMPONENT_REF, TREE_TYPE (f_gtop), valist, f_gtop,
NULL_TREE);
off = build3 (COMPONENT_REF, TREE_TYPE (f_goff), valist, f_goff,
NULL_TREE);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
if (rsize > UNITS_PER_WORD)
{
/* [1] Emit code for: off &= -rsize. */
t = build2 (BIT_AND_EXPR, TREE_TYPE (off), off,
build_int_cst (NULL_TREE, -rsize));
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 (off, t, pre_p);
2002-03-22 10:55:03 +01:00
}
osize = rsize;
}
/* [2] Emit code to branch if off == 0. */
t = build2 (NE_EXPR, boolean_type_node, off,
build_int_cst (TREE_TYPE (off), 0));
addr = build3 (COND_EXPR, ptr_type_node, t, NULL_TREE, NULL_TREE);
/* [5] Emit code for: off -= rsize. We do this as a form of
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
post-decrement not available to C. */
tree.h (build_int_cst): New, sign extended constant. * tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-25 11:52:54 +02:00
t = fold_convert (TREE_TYPE (off), build_int_cst (NULL_TREE, rsize));
t = build2 (POSTDECREMENT_EXPR, TREE_TYPE (off), off, t);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* [4] Emit code for:
addr_rtx = top - off + (BYTES_BIG_ENDIAN ? RSIZE - SIZE : 0). */
t = fold_convert (sizetype, t);
[multiple changes] 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de> Kaz Kojima <kkojima@gcc.gnu.org> * tree-vrp.c (compare_values_warnv): Convert val2 to the type of val1. (extract_range_from_assert): Create POINTER_PLUS_EXPR for pointer types. (extract_range_from_binary_expr): Handle only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR for pointer types. * doc/c-tree.texi (POINTER_PLUS_EXPR): Document. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (number_of_iterations_lt_to_ne): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (assert_loop_rolls_lt): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (number_of_iterations_le): Likewise. (expand_simple_operations): POINTER_PLUS_EXPR are simple also. (derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just like PLUS_EXPR and MINUS_EXPR. * tree-pretty-print.c (dump_generic_node): Handle POINTER_PLUS_EXPR. (op_prio): Likewise. (op_symbol_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-ssa-loop-manip.c (create_iv): Handle pointer base specially. * tree-tailcall.c (process_assignment): Mention POINTER_PLUS_EXPR in a TODO comment. * tree.c (build2_stat): Assert when trying to use PLUS_EXPR or MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR not used with a pointer and an integer type. * tree-scalar-evolution.c (add_to_evolution_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. (follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like PLUS_EXPR except for the right hand side's type will be sizetype. (interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR. (fold_used_pointer_cast): Kill. (pointer_offset_p): Kill. (fold_used_pointer): Kill. (pointer_used_p): Kill. (analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't call fold_used_pointer. (instantiate_parameters_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. Handle POINTER_PLUS_EXPR as PLUS_EXPR. * builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (std_gimplify_va_arg_expr): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. (std_expand_builtin_va_start): Use sizetype for the call to make_tree and then convert to the pointer type. (fold_builtin_memchr): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for adding to a pointer. (std_gimplify_va_arg_expr): Use fold_build2 for the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast the operands to sizetype first and then cast the BIT_AND_EXPR back to the pointer type. * fold-const.c (build_range_check): Handle pointer types specially. (extract_array_ref): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Make sure the offset is converted to sizetype. (try_move_mult_to_index): Strip the NOPs from the offset. Remove code argument and replace all uses with PLUS_EXPR. (fold_to_nonsharp_ineq_using_bound): Handle pointer types specially. Don't use a pointer type for MINUS_EXPR. (fold_unary): Handle for (T1)(X op Y), only p+ as that is the only as that can be handled for binary operators now. (fold_binary <case POINTER_PLUS_EXPR>): Add folding of POINTER_PLUS_EXPR. <case PLUS_EXPR>: Add folding of PTR+INT into PTR p+ INT. Don't call try_move_mult_to_index. <case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B) into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into (PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies. Don't call try_move_mult_to_index. (tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR. (tree_expr_nonzero_p): Likewise. (fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead of PLUS_EXPR for the complex expression folding. * tree-chrec.c (chrec_fold_plus_poly_poly): If the first chrec is a pointer type, then the second should be sizetype and not the first's type. For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR instead of PLUS_EXPR. When either operand is zero, convert the other operand. (chrec_apply): Use chrec_convert_rhs on the argument x instead of chrec_convert. (reset_evolution_in_loop): For pointer types, the new_evol should be sizetype. (convert_affine_scev): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_convert_rhs): New function. (chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. * tree-chrec.h (chrec_convert_rhs): New prototype. (build_polynomial_chrec): For pointer types, the right hand * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Remove subtraction case as it is always addition now. Make sure the offset is converted to sizetype. (fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially. Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before. * tree-ssa-loop-ivopts.c (determine_base_object): Abort for PLUS_EXPR in pointer type. Handle POINTER_PLUS_EXPR. (tree_to_aff_combination): Likewise. (force_expr_to_var_cost): Likewise. (force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR of pointer types. * tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (check_va_list_escapes): Likewise. (check_all_va_list_escapes): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Handle POINT_PLUS_EXPR as a PLUS_EXPR. * expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR. (string_constant): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): When adding the offset to the base, use POINTER_PLUS_EXPR. (add_to_parts): Convert the index to sizetype. (create_mem_ref): Create A POINTER_PLUS_EXPR for the one case. * matrix-reorg.c (collect_data_for_malloc_call): Stmt will now only be either INDIRECT_REF and POINTER_PLUS_EXPR. Offset only holds something for PLUS_EXPR. (ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as a PLUS_EXPR. (analyze_transpose): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. (analyze_accesses_for_modify_stmt): Likewise. Remove comment about the type being integral type as it is wrong now. (can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (transform_access_sites): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. Correct the type which the artimentic is done in (is now sizetype). Reindent one loop. * tree-data-ref.c (split_constant_offset): Handle POINTER_PLUS_EXPR * tree-affine.c (tree_to_aff_combination): Likewise. * c-typeck.c (build_unary_op): For pointers create the increment as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * gimplify.c (gimplify_self_mod_expr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR. * tree.def (POINTER_PLUS_EXPR): New tree code. * tree-predcom.c (ref_at_iteration): If we have a pointer type do the multiplication in sizetype. * tree-mudflap.c (mf_xform_derefs_1): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Don't expect there to be a cast for the index as that does not exist anymore. (forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR instead of PLUS_EXPR. Don't check for the first operand of the POINTER_PLUS_EXPR was the index as it cannot be. Call forward_propagate_addr_into_variable_array_index with the SSA_NAME instead of the statement. * varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR. (compare_constant): Likewise. (copy_constant): Likewise. (compute_reloc_for_constant): Likewise. (output_addressed_constants): Likewise. (initializer_constant_valid_p): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Convert the MIN/MAX of the inner type to the outer type before comparing them. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-inline.c (estimate_num_insns_1): Handle POINTER_PLUS_EXPR. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (bump_vector_ptr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for the pointer increment statement. (vect_update_ivs_after_vectorizer): For pointer types, create POINTER_PLUS_EXPR instead of PLUS_EXPR and also create MULT_EXPR in sizetype. (vect_gen_niters_for_prolog_loop): Add a cast when creating byte_misalign. * tree-object-size.c (plus_expr_object_size): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. (check_for_plus_in_loops_1): Likewise. (check_for_plus_in_loops): Likewise. * c-common.c (pointer_int_sum): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-structalias.c (handle_ptr_arith): Handle only POINTER_PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. * tree-cfg.c (verify_expr): Add extra checking for pointers and PLUS_EXPR and MINUS_EXPR. Also add checking to make sure the operands of POINTER_PLUS_EXPR are correct. * config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype with make_tree, instead of a pointer type. * config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR for pointers instead of PLUS_EXPR. (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR when doing addition on pointer types. Use sizetype for the second operand. (spu_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was a pointer. Don't create a BIT_AND_EXPR for pointer types. * config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR for the pointer addition and also use size_int/sizetype for the offset. (ix86_gimplify_va_arg): Likewise. Perform BIT_AND_EXPR on sizetype arguments. * config/sh/sh.c (sh_va_start): Call make_tree with sizetype and convert its result to a pointer type. Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. (sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. Perform BIT_AND_EXPR on sizetype arguments. * config/ia64/ia64.c (ia64_gimplify_va_arg): Use POINTER_PLUS_EXPR for pointers and create the BIT_AND_EXPR in sizetype. * config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. (rs6000_va_start): Likewise. Also use sizetype for the offset. * config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR as PLUS_EXPR/MINUS_EXPR. (hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR. Don't use BIT_AND_EXPR on a pointer type, convert the expression to sizetype first. * config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR for pointers. (mips_gimplify_va_arg_expr): Likewise. Don't create BIT_AND_EXPR in a pointer type. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. * trans-expr.c (gfc_trans_string_copy): Create POINTER_PLUS_EXPR instead of a PLUS_EXPR for pointer types. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_binary_op): For templates build the expression in pieces to avoid the assert in build2_stat. (get_member_function_from_ptrfunc): Change over to using POINTER_PLUS_EXPR and convert the second operand to sizetype. * typeck2.c (build_m_component_ref): Likewise. * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * class.c (build_base_path): Likewise. (build_base_path): Likewise. (convert_to_base_statically): Likewise. (fixed_type_or_null): Handle POINTER_PLUS_EXPR. (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * call.c (build_special_member_call): Likewise. * rtti.c (build_headof): Likewise. Use sizetype instead of ptrdiff_type_node. (tinfo_base_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * except.c (expand_start_catch_block): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert PLUS_EXPR on pointer types over to use POINTER_PLUS_EXPR and remove the conversion to the pointer types. * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for adding to a pointer type. Use size_int instead of ssize_int. Convert the index to sizetype before adding it to the pointer. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans.c (Attribute_to_gnu): When subtracting an offset from a pointer, use POINTER_PLUS_EXPR with NEGATE_EXPR instead of MINUS_EXPR. (gnat_to_gnu): Likewise. * utils.c (convert): When converting between thin pointers, use POINTER_PLUS_EXPR and sizetype for the offset. * utils2.c (known_alignment): POINTER_PLUS_EXPR have the same semantics as PLUS_EXPR for alignment. (build_binary_op): Add support for the semantics of POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * class.c (make_class_data): Build the index in sizetype. Use POINTER_PLUS_EXPR instead of PLUS_EXPR when adding to a pointer type. (build_symbol_entry): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. * except.c (build_exception_object_ref): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32225 * gcc.c-torture/compile/20070605-1.c: New test. * gcc.c-torture/compile/20070603-1.c: New testcase. * gcc.c-torture/compile/20070603-2.c: New testcase. * gcc.c-torture/compile/20070531-1.c: New test. PR tree-opt/32167 * gcc.c-torture/compile/20070531-2.c: New test. PR tree-opt/32144 * gcc.c-torture/compile/20070529-1.c: New test. PR tree-opt/32145 * gcc.c-torture/compile/20070529-2.c: New test. PR tree-opt/32015 * gcc.c-torture/compile/20070520-1.c: New test. * g++.dg/ext/java-1.C: New test. * gcc.dg/vect/vect-106.c: We are now able to vectorize two loops instead of one. Remove the "can't determine dependence" check. * gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer needed as the cast is gone in the first place. * gcc.dg/max-1.c: Change local variable a to be a global one. * gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't have a cast which is PREd. From-SVN: r125755
2007-06-16 07:42:36 +02:00
t = fold_build1 (NEGATE_EXPR, sizetype, t);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (top), top, t);
if (BYTES_BIG_ENDIAN && rsize > size)
{
[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 = size_int (rsize - size);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, u);
}
COND_EXPR_THEN (addr) = t;
if (osize > UNITS_PER_WORD)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* [9] Emit: ovfl = ((intptr_t) ovfl + osize - 1) & -osize. */
[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 = size_int (osize - 1);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovfl), ovfl, u);
t = fold_convert (sizetype, t);
u = size_int (-osize);
t = build2 (BIT_AND_EXPR, sizetype, t, u);
t = fold_convert (TREE_TYPE (ovfl), t);
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
2002-03-22 10:55:03 +01:00
}
else
align = NULL;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* [10, 11] Emit code for:
addr_rtx = ovfl + (BYTES_BIG_ENDIAN ? OSIZE - SIZE : 0)
ovfl += osize. */
u = fold_convert (TREE_TYPE (ovfl), build_int_cst (NULL_TREE, osize));
t = build2 (POSTINCREMENT_EXPR, TREE_TYPE (ovfl), ovfl, u);
if (BYTES_BIG_ENDIAN && osize > size)
2002-03-22 10:55:03 +01:00
{
[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 = size_int (osize - size);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, u);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* String [9] and [10, 11] together. */
if (align)
t = build2 (COMPOUND_EXPR, TREE_TYPE (t), align, t);
COND_EXPR_ELSE (addr) = t;
addr = fold_convert (build_pointer_type (type), addr);
addr = build_va_arg_indirect_ref (addr);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (indirect_p)
addr = build_va_arg_indirect_ref (addr);
return addr;
}
/* Start a definition of function NAME. MIPS16_P indicates whether the
function contains MIPS16 code. */
static void
mips_start_function_definition (const char *name, bool mips16_p)
{
if (mips16_p)
fprintf (asm_out_file, "\t.set\tmips16\n");
else
fprintf (asm_out_file, "\t.set\tnomips16\n");
if (!flag_inhibit_size_directive)
{
fputs ("\t.ent\t", asm_out_file);
assemble_name (asm_out_file, name);
fputs ("\n", asm_out_file);
}
ASM_OUTPUT_TYPE_DIRECTIVE (asm_out_file, name, "function");
/* Start the definition proper. */
assemble_name (asm_out_file, name);
fputs (":\n", asm_out_file);
}
/* End a function definition started by mips_start_function_definition. */
static void
mips_end_function_definition (const char *name)
{
if (!flag_inhibit_size_directive)
{
fputs ("\t.end\t", asm_out_file);
assemble_name (asm_out_file, name);
fputs ("\n", asm_out_file);
}
}
/* Return true if calls to X can use R_MIPS_CALL* relocations. */
static bool
mips_ok_for_lazy_binding_p (rtx x)
{
return (TARGET_USE_GOT
&& GET_CODE (x) == SYMBOL_REF
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
&& !SYMBOL_REF_BIND_NOW_P (x)
&& !mips_symbol_binds_local_p (x));
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Load function address ADDR into register DEST. TYPE is as for
mips_expand_call. Return true if we used an explicit lazy-binding
sequence. */
static bool
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
mips_load_call_address (enum mips_call_type type, rtx dest, rtx addr)
{
/* If we're generating PIC, and this call is to a global function,
try to allow its address to be resolved lazily. This isn't
possible for sibcalls when $gp is call-saved because the value
of $gp on entry to the stub would be our caller's gp, not ours. */
if (TARGET_EXPLICIT_RELOCS
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
&& !(type == MIPS_CALL_SIBCALL && TARGET_CALL_SAVED_GP)
&& mips_ok_for_lazy_binding_p (addr))
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
addr = mips_got_load (dest, addr, SYMBOL_GOTOFF_CALL);
emit_insn (gen_rtx_SET (VOIDmode, dest, addr));
return true;
}
else
{
mips_emit_move (dest, addr);
return false;
}
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Each locally-defined hard-float MIPS16 function has a local symbol
associated with it. This hash table maps the function symbol (FUNC)
to the local symbol (LOCAL). */
struct mips16_local_alias GTY(()) {
rtx func;
rtx local;
};
static GTY ((param_is (struct mips16_local_alias))) htab_t mips16_local_aliases;
/* Hash table callbacks for mips16_local_aliases. */
static hashval_t
mips16_local_aliases_hash (const void *entry)
{
const struct mips16_local_alias *alias;
alias = (const struct mips16_local_alias *) entry;
return htab_hash_string (XSTR (alias->func, 0));
}
static int
mips16_local_aliases_eq (const void *entry1, const void *entry2)
{
const struct mips16_local_alias *alias1, *alias2;
alias1 = (const struct mips16_local_alias *) entry1;
alias2 = (const struct mips16_local_alias *) entry2;
return rtx_equal_p (alias1->func, alias2->func);
}
/* FUNC is the symbol for a locally-defined hard-float MIPS16 function.
Return a local alias for it, creating a new one if necessary. */
static rtx
mips16_local_alias (rtx func)
{
struct mips16_local_alias *alias, tmp_alias;
void **slot;
/* Create the hash table if this is the first call. */
if (mips16_local_aliases == NULL)
mips16_local_aliases = htab_create_ggc (37, mips16_local_aliases_hash,
mips16_local_aliases_eq, NULL);
/* Look up the function symbol, creating a new entry if need be. */
tmp_alias.func = func;
slot = htab_find_slot (mips16_local_aliases, &tmp_alias, INSERT);
gcc_assert (slot != NULL);
alias = (struct mips16_local_alias *) *slot;
if (alias == NULL)
{
const char *func_name, *local_name;
rtx local;
/* Create a new SYMBOL_REF for the local symbol. The choice of
__fn_local_* is based on the __fn_stub_* names that we've
traditionally used for the non-MIPS16 stub. */
func_name = targetm.strip_name_encoding (XSTR (func, 0));
local_name = ACONCAT (("__fn_local_", func_name, NULL));
local = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (local_name));
SYMBOL_REF_FLAGS (local) = SYMBOL_REF_FLAGS (func) | SYMBOL_FLAG_LOCAL;
/* Create a new structure to represent the mapping. */
alias = GGC_NEW (struct mips16_local_alias);
alias->func = func;
alias->local = local;
*slot = alias;
}
return alias->local;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* A chained list of functions for which mips16_build_call_stub has already
generated a stub. NAME is the name of the function and FP_RET_P is true
if the function returns a value in floating-point registers. */
struct mips16_stub {
struct mips16_stub *next;
char *name;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
bool fp_ret_p;
};
static struct mips16_stub *mips16_stubs;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Return a SYMBOL_REF for a MIPS16 function called NAME. */
static rtx
mips16_stub_function (const char *name)
{
rtx x;
x = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
SYMBOL_REF_FLAGS (x) |= (SYMBOL_FLAG_EXTERNAL | SYMBOL_FLAG_FUNCTION);
return x;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return the two-character string that identifies floating-point
return mode MODE in the name of a MIPS16 function stub. */
static const char *
mips16_call_stub_mode_suffix (enum machine_mode mode)
{
if (mode == SFmode)
return "sf";
else if (mode == DFmode)
return "df";
else if (mode == SCmode)
return "sc";
else if (mode == DCmode)
return "dc";
else if (mode == V2SFmode)
return "df";
else
gcc_unreachable ();
}
/* Write instructions to move a 32-bit value between general register
GPREG and floating-point register FPREG. DIRECTION is 't' to move
from GPREG to FPREG and 'f' to move in the opposite direction. */
static void
mips_output_32bit_xfer (char direction, unsigned int gpreg, unsigned int fpreg)
{
fprintf (asm_out_file, "\tm%cc1\t%s,%s\n", direction,
reg_names[gpreg], reg_names[fpreg]);
}
/* Likewise for 64-bit values. */
static void
mips_output_64bit_xfer (char direction, unsigned int gpreg, unsigned int fpreg)
{
if (TARGET_64BIT)
fprintf (asm_out_file, "\tdm%cc1\t%s,%s\n", direction,
reg_names[gpreg], reg_names[fpreg]);
else if (TARGET_FLOAT64)
{
fprintf (asm_out_file, "\tm%cc1\t%s,%s\n", direction,
reg_names[gpreg + TARGET_BIG_ENDIAN], reg_names[fpreg]);
fprintf (asm_out_file, "\tm%chc1\t%s,%s\n", direction,
reg_names[gpreg + TARGET_LITTLE_ENDIAN], reg_names[fpreg]);
}
else
{
/* Move the least-significant word. */
fprintf (asm_out_file, "\tm%cc1\t%s,%s\n", direction,
reg_names[gpreg + TARGET_BIG_ENDIAN], reg_names[fpreg]);
/* ...then the most significant word. */
fprintf (asm_out_file, "\tm%cc1\t%s,%s\n", direction,
reg_names[gpreg + TARGET_LITTLE_ENDIAN], reg_names[fpreg + 1]);
}
}
/* Write out code to move floating-point arguments into or out of
general registers. FP_CODE is the code describing which arguments
are present (see the comment above the definition of CUMULATIVE_ARGS
in mips.h). DIRECTION is as for mips_output_32bit_xfer. */
static void
mips_output_args_xfer (int fp_code, char direction)
{
unsigned int gparg, fparg, f;
CUMULATIVE_ARGS cum;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* This code only works for o32 and o64. */
gcc_assert (TARGET_OLDABI);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_init_cumulative_args (&cum, NULL);
for (f = (unsigned int) fp_code; f != 0; f >>= 2)
{
enum machine_mode mode;
struct mips_arg_info info;
if ((f & 3) == 1)
mode = SFmode;
else if ((f & 3) == 2)
mode = DFmode;
else
gcc_unreachable ();
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_get_arg_info (&info, &cum, mode, NULL, true);
gparg = mips_arg_regno (&info, false);
fparg = mips_arg_regno (&info, true);
if (mode == SFmode)
mips_output_32bit_xfer (direction, gparg, fparg);
else
mips_output_64bit_xfer (direction, gparg, fparg);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_function_arg_advance (&cum, mode, NULL, true);
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Write a MIPS16 stub for the current function. This stub is used
for functions which take arguments in the floating-point registers.
It is normal-mode code that moves the floating-point arguments
into the general registers and then jumps to the MIPS16 code. */
static void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_build_function_stub (void)
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
const char *fnname, *alias_name, *separator;
char *secname, *stubname;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
tree stubdecl;
unsigned int f;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx symbol, alias;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Create the name of the stub, and its unique section. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
symbol = XEXP (DECL_RTL (current_function_decl), 0);
alias = mips16_local_alias (symbol);
fnname = targetm.strip_name_encoding (XSTR (symbol, 0));
alias_name = targetm.strip_name_encoding (XSTR (alias, 0));
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
secname = ACONCAT ((".mips16.fn.", fnname, NULL));
stubname = ACONCAT (("__fn_stub_", fnname, NULL));
/* Build a decl for the stub. */
stubdecl = build_decl (FUNCTION_DECL, get_identifier (stubname),
build_function_type (void_type_node, NULL_TREE));
DECL_SECTION_NAME (stubdecl) = build_string (strlen (secname), secname);
DECL_RESULT (stubdecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Output a comment. */
fprintf (asm_out_file, "\t# Stub function for %s (",
current_function_name ());
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
separator = "";
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
for (f = (unsigned int) crtl->args.info.fp_code; f != 0; f >>= 2)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fprintf (asm_out_file, "%s%s", separator,
(f & 3) == 1 ? "float" : "double");
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
separator = ", ";
}
fprintf (asm_out_file, ")\n");
/* Start the function definition. */
assemble_start_function (stubdecl, stubname);
mips_start_function_definition (stubname, false);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* If generating abicalls code, either set up the global pointer or
switch to absolute mode. */
if (TARGET_ABSOLUTE_ABICALLS)
fprintf (asm_out_file, "\t.option\tpic0\n");
else if (TARGET_ABICALLS)
{
output_asm_insn ("%(.cpload\t%^%)", NULL);
/* Emit an R_MIPS_NONE relocation to tell the linker what the
target function is. Use a local GOT access when loading the
symbol, to cut down on the number of unnecessary GOT entries
for stubs that aren't needed. */
output_asm_insn (".reloc\t0,R_MIPS_NONE,%0", &symbol);
symbol = alias;
}
/* Load the address of the MIPS16 function into $at. Do this first so
that targets with coprocessor interlocks can use an MFC1 to fill the
delay slot. */
fprintf (asm_out_file, "\t.set\tnoat\n");
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
output_asm_insn ("la\t%@,%0", &symbol);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Move the arguments from floating-point registers to general registers. */
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
mips_output_args_xfer (crtl->args.info.fp_code, 'f');
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Jump to the MIPS16 function. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
output_asm_insn ("jr\t%@", NULL);
fprintf (asm_out_file, "\t.set\tat\n");
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_ABSOLUTE_ABICALLS)
fprintf (asm_out_file, "\t.option\tpic2\n");
mips_end_function_definition (stubname);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* If the linker needs to create a dynamic symbol for the target
function, it will associate the symbol with the stub (which,
unlike the target function, follows the proper calling conventions).
It is therefore useful to have a local alias for the target function,
so that it can still be identified as MIPS16 code. As an optimization,
this symbol can also be used for indirect MIPS16 references from
within this file. */
ASM_OUTPUT_DEF (asm_out_file, alias_name, fnname);
switch_to_section (function_section (current_function_decl));
}
/* The current function is a MIPS16 function that returns a value in an FPR.
Copy the return value from its soft-float to its hard-float location.
libgcc2 has special non-MIPS16 helper functions for each case. */
static void
mips16_copy_fpr_return_value (void)
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx fn, insn, retval;
tree return_type;
enum machine_mode return_mode;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
const char *name;
return_type = DECL_RESULT (current_function_decl);
return_mode = DECL_MODE (return_type);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
name = ACONCAT (("__mips16_ret_",
mips16_call_stub_mode_suffix (return_mode),
NULL));
fn = mips16_stub_function (name);
/* The function takes arguments in $2 (and possibly $3), so calls
to it cannot be lazily bound. */
SYMBOL_REF_FLAGS (fn) |= SYMBOL_FLAG_BIND_NOW;
/* Model the call as something that takes the GPR return value as
argument and returns an "updated" value. */
retval = gen_rtx_REG (return_mode, GP_RETURN);
insn = mips_expand_call (MIPS_CALL_EPILOGUE, retval, fn,
const0_rtx, NULL_RTX, false);
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), retval);
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Consider building a stub for a MIPS16 call to function *FN_PTR.
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
RETVAL is the location of the return value, or null if this is
a "call" rather than a "call_value". ARGS_SIZE is the size of the
arguments and FP_CODE is the code built by mips_function_arg;
see the comment above CUMULATIVE_ARGS for details.
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
There are three alternatives:
- If a stub was needed, emit the call and return the call insn itself.
- If we can avoid using a stub by redirecting the call, set *FN_PTR
to the new target and return null.
- If *FN_PTR doesn't need a stub, return null and leave *FN_PTR
unmodified.
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
A stub is needed for calls to functions that, in normal mode,
receive arguments in FPRs or return values in FPRs. The stub
copies the arguments from their soft-float positions to their
hard-float positions, calls the real function, then copies the
return value from its hard-float position to its soft-float
position.
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
We can emit a JAL to *FN_PTR even when *FN_PTR might need a stub.
If *FN_PTR turns out to be to a non-MIPS16 function, the linker
automatically redirects the JAL to the stub, otherwise the JAL
continues to call FN directly. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
static rtx
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
{
const char *fnname;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
bool fp_ret_p;
struct mips16_stub *l;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx insn, fn;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* We don't need to do anything if we aren't in MIPS16 mode, or if
we were invoked with the -msoft-float option. */
if (!TARGET_MIPS16 || TARGET_SOFT_FLOAT_ABI)
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
return NULL_RTX;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Figure out whether the value might come back in a floating-point
register. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fp_ret_p = retval && mips_return_mode_in_fpr_p (GET_MODE (retval));
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* We don't need to do anything if there were no floating-point
arguments and the value will not be returned in a floating-point
register. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (fp_code == 0 && !fp_ret_p)
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
return NULL_RTX;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
/* We don't need to do anything if this is a call to a special
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
MIPS16 support function. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
fn = *fn_ptr;
if (mips16_stub_function_p (fn))
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
return NULL_RTX;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
/* This code will only work for o32 and o64 abis. The other ABI's
require more sophisticated support. */
gcc_assert (TARGET_OLDABI);
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If we're calling via a function pointer, use one of the magic
libgcc.a stubs provided for each (FP_CODE, FP_RET_P) combination.
Each stub expects the function address to arrive in register $2. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (GET_CODE (fn) != SYMBOL_REF
|| !call_insn_operand (fn, VOIDmode))
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
{
char buf[30];
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx stub_fn, insn, addr;
bool lazy_p;
/* If this is a locally-defined and locally-binding function,
avoid the stub by calling the local alias directly. */
if (mips16_local_function_p (fn))
{
*fn_ptr = mips16_local_alias (fn);
return NULL_RTX;
}
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Create a SYMBOL_REF for the libgcc.a function. */
if (fp_ret_p)
sprintf (buf, "__mips16_call_stub_%s_%d",
mips16_call_stub_mode_suffix (GET_MODE (retval)),
fp_code);
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
sprintf (buf, "__mips16_call_stub_%d", fp_code);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
stub_fn = mips16_stub_function (buf);
/* The function uses $2 as an argument, so calls to it
cannot be lazily bound. */
SYMBOL_REF_FLAGS (stub_fn) |= SYMBOL_FLAG_BIND_NOW;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Load the target function into $2. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
addr = gen_rtx_REG (Pmode, GP_REG_FIRST + 2);
lazy_p = mips_load_call_address (MIPS_CALL_NORMAL, addr, fn);
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Emit the call. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
insn = mips_expand_call (MIPS_CALL_NORMAL, retval, stub_fn,
args_size, NULL_RTX, lazy_p);
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Tell GCC that this call does indeed use the value of $2. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), addr);
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If we are handling a floating-point return value, we need to
save $18 in the function prologue. Putting a note on the
call will mean that df_regs_ever_live_p ($18) will be true if the
call is not eliminated, and we can check that in the prologue
code. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (fp_ret_p)
CALL_INSN_FUNCTION_USAGE (insn) =
gen_rtx_EXPR_LIST (VOIDmode,
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
gen_rtx_CLOBBER (VOIDmode,
gen_rtx_REG (word_mode, 18)),
CALL_INSN_FUNCTION_USAGE (insn));
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
return insn;
}
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
/* We know the function we are going to call. If we have already
built a stub, we don't need to do anything further. */
fnname = targetm.strip_name_encoding (XSTR (fn, 0));
for (l = mips16_stubs; l != NULL; l = l->next)
if (strcmp (l->name, fnname) == 0)
break;
if (l == NULL)
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
const char *separator;
char *secname, *stubname;
tree stubid, stubdecl;
unsigned int f;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If the function does not return in FPRs, the special stub
section is named
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
.mips16.call.FNNAME
If the function does return in FPRs, the stub section is named
.mips16.call.fp.FNNAME
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
Build a decl for the stub. */
secname = ACONCAT ((".mips16.call.", fp_ret_p ? "fp." : "",
fnname, NULL));
stubname = ACONCAT (("__call_stub_", fp_ret_p ? "fp_" : "",
fnname, NULL));
stubid = get_identifier (stubname);
stubdecl = build_decl (FUNCTION_DECL, stubid,
build_function_type (void_type_node, NULL_TREE));
DECL_SECTION_NAME (stubdecl) = build_string (strlen (secname), secname);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
DECL_RESULT (stubdecl) = build_decl (RESULT_DECL, NULL_TREE,
void_type_node);
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Output a comment. */
fprintf (asm_out_file, "\t# Stub function to call %s%s (",
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
(fp_ret_p
? (GET_MODE (retval) == SFmode ? "float " : "double ")
: ""),
fnname);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
separator = "";
for (f = (unsigned int) fp_code; f != 0; f >>= 2)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fprintf (asm_out_file, "%s%s", separator,
(f & 3) == 1 ? "float" : "double");
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
separator = ", ";
}
fprintf (asm_out_file, ")\n");
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
/* Start the function definition. */
assemble_start_function (stubdecl, stubname);
mips_start_function_definition (stubname, false);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!fp_ret_p)
{
/* Load the address of the MIPS16 function into $at. Do this
first so that targets with coprocessor interlocks can use
an MFC1 to fill the delay slot. */
fprintf (asm_out_file, "\t.set\tnoat\n");
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_EXPLICIT_RELOCS)
{
output_asm_insn ("lui\t%^,%%hi(%0)", &fn);
output_asm_insn ("addiu\t%^,%^,%%lo(%0)", &fn);
}
else
output_asm_insn ("la\t%^,%0", &fn);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Move the arguments from general registers to floating-point
registers. */
mips_output_args_xfer (fp_code, 't');
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!fp_ret_p)
{
/* Jump to the previously-loaded address. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
output_asm_insn ("jr\t%^", NULL);
fprintf (asm_out_file, "\t.set\tat\n");
}
else
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Save the return address in $18 and call the non-MIPS16 function.
The stub's caller knows that $18 might be clobbered, even though
$18 is usually a call-saved register. */
fprintf (asm_out_file, "\tmove\t%s,%s\n",
reg_names[GP_REG_FIRST + 18], reg_names[GP_REG_FIRST + 31]);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
output_asm_insn (MIPS_CALL ("jal", &fn, 0), &fn);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Move the result from floating-point registers to
general registers. */
switch (GET_MODE (retval))
{
case SCmode:
mips_output_32bit_xfer ('f', GP_RETURN + 1,
FP_REG_FIRST + MAX_FPRS_PER_FMT);
/* Fall though. */
case SFmode:
mips_output_32bit_xfer ('f', GP_RETURN, FP_REG_FIRST);
if (GET_MODE (retval) == SCmode && TARGET_64BIT)
{
/* On 64-bit targets, complex floats are returned in
a single GPR, such that "sd" on a suitably-aligned
target would store the value correctly. */
fprintf (asm_out_file, "\tdsll\t%s,%s,32\n",
reg_names[GP_RETURN + TARGET_LITTLE_ENDIAN],
reg_names[GP_RETURN + TARGET_LITTLE_ENDIAN]);
fprintf (asm_out_file, "\tor\t%s,%s,%s\n",
reg_names[GP_RETURN],
reg_names[GP_RETURN],
reg_names[GP_RETURN + 1]);
}
break;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
case DCmode:
mips_output_64bit_xfer ('f', GP_RETURN + (8 / UNITS_PER_WORD),
FP_REG_FIRST + MAX_FPRS_PER_FMT);
/* Fall though. */
case DFmode:
case V2SFmode:
mips_output_64bit_xfer ('f', GP_RETURN, FP_REG_FIRST);
break;
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
default:
gcc_unreachable ();
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fprintf (asm_out_file, "\tjr\t%s\n", reg_names[GP_REG_FIRST + 18]);
}
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
#ifdef ASM_DECLARE_FUNCTION_SIZE
ASM_DECLARE_FUNCTION_SIZE (asm_out_file, stubname, stubdecl);
#endif
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
mips_end_function_definition (stubname);
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
/* Record this stub. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
l = XNEW (struct mips16_stub);
l->name = xstrdup (fnname);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
l->fp_ret_p = fp_ret_p;
l->next = mips16_stubs;
mips16_stubs = l;
}
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If we expect a floating-point return value, but we've built a
stub which does not expect one, then we're in trouble. We can't
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
use the existing stub, because it won't handle the floating-point
value. We can't build a new stub, because the linker won't know
which stub to use for the various calls in this object file.
Fortunately, this case is illegal, since it means that a function
was declared in two different ways in a single compilation. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (fp_ret_p && !l->fp_ret_p)
error ("cannot handle inconsistent calls to %qs", fnname);
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
if (retval == NULL_RTX)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
insn = gen_call_internal_direct (fn, args_size);
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
insn = gen_call_value_internal_direct (retval, fn, args_size);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
insn = mips_emit_call_insn (insn, fn, fn, false);
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If we are calling a stub which handles a floating-point return
value, we need to arrange to save $18 in the prologue. We do this
by marking the function call as using the register. The prologue
will later see that it is used, and emit code to save it. */
if (fp_ret_p)
CALL_INSN_FUNCTION_USAGE (insn) =
gen_rtx_EXPR_LIST (VOIDmode,
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
gen_rtx_CLOBBER (VOIDmode,
gen_rtx_REG (word_mode, 18)),
CALL_INSN_FUNCTION_USAGE (insn));
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
return insn;
mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. gcc/ 2007-09-13 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Delete. (SYMBOL_REF_MIPS16_FUNC_P): Delete. * config/mips/mips.c (mips_attribute_table): Turn mips16 and nomips16 into decl attributes. (TARGET_INSERT_ATTRIBUTES): Override. (TARGET_MERGE_DECL_ATTRIBUTES): Likewise. (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Always return true. (mips_mips16_type_p, mips_nomips16_type_p): Delete in favor of... (mips_mips16_decl_p, mips_nomips16_decl_p): ...these new functions. (mips_comp_type_attributes): Remove mips16 and nomips16 handling. (mips_use_mips16_mode_p): Reimplement as a function that takes a decl and considers only decl attributes. If the decl is nested function, use its parent attributes. (mips_function_ok_for_sibcall): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_set_mips16_mode): Move call to sorry here from old mips_use_mips16_mode_p. (mflip_mips16_entry): New structure. (mflip_mips16_htab): New variable. (mflip_mips16_htab_hash, mflip_mips16_htab_eq): New functions. (mflip_mips16_use_mips16_p, mips_insert_attributes): Likewise. (mips_merge_decl_attributes): New function. (mips_set_current_function): Reinstate call to mips_set_mips16_mode. Use mips_use_mips16_mode_p. (mips_output_mi_thunk): Use mips_use_mips16_mode_p instead of SYMBOL_REF_MIPS16_FUNC_P. (mips_encode_section_info): Don't set SYMBOL_FLAG_MIPS16_FUNC. gcc/testsuite/ * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16. * gcc.target/mips/mips16-attributes-2.c: New test. * gcc.target/mips/mips16-attributes-3.c: Likewise. * gcc.target/mips/args-3.c: Skip for -mflip-mips16. Do not use the hard-float asm when __mips16 is defined. * gcc.target/mips/atomic-memory-1.c (main): Add a nomips16 attribute. * gcc.target/mips/atomic-memory-2.c (main): Likewise. * gcc.target/mips/fpcmp-1.c (f1, f2): Likewise. * gcc.target/mips/fpcmp-2.c (f1, f2): Likewise. * gcc.target/mips/neg-abs-1.c (f1, f2, d1, f2): Likewise. * gcc.target/mips/pr26765.c (foo): Likewise. * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Run for all targets, use dg-mips-options instead of dg-options, and use -mgp32 to force 32-bit mode. * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise -mgp64 and 64-bit mode. * gcc.target/mips/mips.exp (is_gp32_flag): Return true for -mips32*. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r128460
2007-09-13 14:44:10 +02:00
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Expand a call of type TYPE. RESULT is where the result will go (null
for "call"s and "sibcall"s), ADDR is the address of the function,
ARGS_SIZE is the size of the arguments and AUX is the value passed
to us by mips_function_arg. LAZY_P is true if this call already
involves a lazily-bound function address (such as when calling
functions through a MIPS16 hard-float stub).
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
Return the call itself. */
rtx
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
mips_expand_call (enum mips_call_type type, rtx result, rtx addr,
rtx args_size, rtx aux, bool lazy_p)
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
{
rtx orig_addr, pattern, insn;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
int fp_code;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
fp_code = aux == 0 ? 0 : (int) GET_MODE (aux);
insn = mips16_build_call_stub (result, &addr, args_size, fp_code);
if (insn)
{
gcc_assert (!lazy_p && type == MIPS_CALL_NORMAL);
return insn;
}
;
orig_addr = addr;
if (!call_insn_operand (addr, VOIDmode))
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (type == MIPS_CALL_EPILOGUE)
addr = MIPS_EPILOGUE_TEMP (Pmode);
else
addr = gen_reg_rtx (Pmode);
lazy_p |= mips_load_call_address (type, addr, orig_addr);
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (result == 0)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx (*fn) (rtx, rtx);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (type == MIPS_CALL_EPILOGUE && TARGET_SPLIT_CALLS)
fn = gen_call_split;
else if (type == MIPS_CALL_SIBCALL)
fn = gen_sibcall_internal;
else
fn = gen_call_internal;
pattern = fn (addr, args_size);
}
else if (GET_CODE (result) == PARALLEL && XVECLEN (result, 0) == 2)
{
/* Handle return values created by mips_return_fpr_pair. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx (*fn) (rtx, rtx, rtx, rtx);
rtx reg1, reg2;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (type == MIPS_CALL_EPILOGUE && TARGET_SPLIT_CALLS)
fn = gen_call_value_multiple_split;
else if (type == MIPS_CALL_SIBCALL)
fn = gen_sibcall_value_multiple_internal;
else
fn = gen_call_value_multiple_internal;
reg1 = XEXP (XVECEXP (result, 0, 0), 0);
reg2 = XEXP (XVECEXP (result, 0, 1), 0);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
pattern = fn (reg1, addr, args_size, reg2);
}
else
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
rtx (*fn) (rtx, rtx, rtx);
if (type == MIPS_CALL_EPILOGUE && TARGET_SPLIT_CALLS)
fn = gen_call_value_split;
else if (type == MIPS_CALL_SIBCALL)
fn = gen_sibcall_value_internal;
else
fn = gen_call_value_internal;
/* Handle return values created by mips_return_fpr_single. */
if (GET_CODE (result) == PARALLEL && XVECLEN (result, 0) == 1)
result = XEXP (XVECEXP (result, 0, 0), 0);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
pattern = fn (result, addr, args_size);
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
return mips_emit_call_insn (pattern, orig_addr, addr, lazy_p);
}
/* Split call instruction INSN into a $gp-clobbering call and
(where necessary) an instruction to restore $gp from its save slot.
CALL_PATTERN is the pattern of the new call. */
void
mips_split_call (rtx insn, rtx call_pattern)
{
rtx new_insn;
new_insn = emit_call_insn (call_pattern);
CALL_INSN_FUNCTION_USAGE (new_insn)
= copy_rtx (CALL_INSN_FUNCTION_USAGE (insn));
if (!find_reg_note (insn, REG_NORETURN, 0))
/* Pick a temporary register that is suitable for both MIPS16 and
non-MIPS16 code. $4 and $5 are used for returning complex double
values in soft-float code, so $6 is the first suitable candidate. */
mips_restore_gp (gen_rtx_REG (Pmode, GP_ARG_FIRST + 2));
}
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
/* Implement TARGET_FUNCTION_OK_FOR_SIBCALL. */
static bool
mips_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
1992-02-06 21:09:50 +01:00
{
if (!TARGET_SIBCALLS)
return false;
1992-02-06 21:09:50 +01:00
/* We can't do a sibcall if the called function is a MIPS16 function
because there is no direct "jx" instruction equivalent to "jalx" to
switch the ISA mode. We only care about cases where the sibling
and normal calls would both be direct. */
if (mips_use_mips16_mode_p (decl)
&& const_call_insn_operand (XEXP (DECL_RTL (decl), 0), VOIDmode))
return false;
/* When -minterlink-mips16 is in effect, assume that non-locally-binding
functions could be MIPS16 ones unless an attribute explicitly tells
us otherwise. */
if (TARGET_INTERLINK_MIPS16
&& decl
2007-12-06 18:54:59 +01:00
&& (DECL_EXTERNAL (decl) || !targetm.binds_local_p (decl))
&& !mips_nomips16_decl_p (decl)
&& const_call_insn_operand (XEXP (DECL_RTL (decl), 0), VOIDmode))
return false;
1992-02-06 21:09:50 +01:00
/* Otherwise OK. */
return true;
}
/* Emit code to move general operand SRC into condition-code
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
register DEST given that SCRATCH is a scratch TFmode FPR.
The sequence is:
(dfhigh, dflow, sfhigh, sflow): New variables. (mips_sw_reg_names): Consistently use $ as name prefix. (large_int): Handle 64 bit constants. (reg_or_0_operand, mips_const_double_ok): Don't examine CONST_DOUBLE internals. (mips_const_double_ok): Use REAL_VALUE_* macros. (simple_memory_operand): Add 64 bit support. Only test TARGET_GP_OPT to determine if doing gp optimizations. Pass address not MEM to eliminate_constant_term. Use SMALL_INT. (mips_fill_delay_slot): Add 64 bit support. (mips_move_1word): Add 64 bit support. Don't examine CONST_DOUBLE internals. (mips_move_2words): Likewise. (mips_address_cost): Pass address not MEM to eliminate_constant_term. Use SMALL_INT. (gen_int_relational): New variable mode. Add 64 bit support. (gen_conditional_branch): Add 64 bit support. (block_move_load_store, block_move_loop, block_move_call, expand_block_move, output_block_move, function_arg_advance, function_arg, function_arg_partial_nregs): Likewise. (override_options): Clear MASK_GPOPT if threshold is zero or negative. Set MASK_GPOPT if optimizing. Set mips_isa from -misa= option, else from MIPS_ISA_DEFAULT if defined, else to 1. Make default cpu depend on isa. Add cpus r4400, r4600, orion. Rewrite TARGET_NAME_REGS support. Initialize dfhigh, dflow, sfhigh, sflow. Add 64 bit support. (print_operand): Use REAL_VALUE_* macros. (mips_output_external): Don't depend on mips_section_threshold. (make_temp_file): Define P_tmpdir when __MSDOS__. Malloc filename string. Don't unlink temp file when __MSDOS__. (mips_asm_file_start): Delete TARGET_NAME_REGS support. (mips_asm_file_end): Unlike temp file when __MSDOS__. (mips_declare_object): Don't test mips_sections_threshold. (compute_frame_size, save_restore_insns, function_prologue, mips_expand_prologue, function_epilogue, mips_expand_epilogue): Add 64 bit support. (function_epilogue): Correctly output `#' before .set volatile. From-SVN: r6391
1994-01-14 00:51:01 +01:00
FP1 = SRC
FP2 = 0.0f
DEST = FP2 < FP1
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
where FP1 and FP2 are single-precision FPRs taken from SCRATCH. */
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_fcc_reload (rtx dest, rtx src, rtx scratch)
{
rtx fp1, fp2;
/* Change the source to SFmode. */
if (MEM_P (src))
src = adjust_address (src, SFmode, 0);
else if (REG_P (src) || GET_CODE (src) == SUBREG)
src = gen_rtx_REG (SFmode, true_regnum (src));
fp1 = gen_rtx_REG (SFmode, REGNO (scratch));
fp2 = gen_rtx_REG (SFmode, REGNO (scratch) + MAX_FPRS_PER_FMT);
mips_emit_move (copy_rtx (fp1), src);
mips_emit_move (copy_rtx (fp2), CONST0_RTX (SFmode));
emit_insn (gen_slt_sf (dest, fp2, fp1));
}
/* Emit straight-line code to move LENGTH bytes from SRC to DEST.
Assume that the areas do not overlap. */
static void
mips_block_move_straight (rtx dest, rtx src, HOST_WIDE_INT length)
{
HOST_WIDE_INT offset, delta;
unsigned HOST_WIDE_INT bits;
int i;
enum machine_mode mode;
rtx *regs;
/* Work out how many bits to move at a time. If both operands have
half-word alignment, it is usually better to move in half words.
For instance, lh/lh/sh/sh is usually better than lwl/lwr/swl/swr
and lw/lw/sw/sw is usually better than ldl/ldr/sdl/sdr.
Otherwise move word-sized chunks. */
if (MEM_ALIGN (src) == BITS_PER_WORD / 2
&& MEM_ALIGN (dest) == BITS_PER_WORD / 2)
bits = BITS_PER_WORD / 2;
else
bits = BITS_PER_WORD;
mode = mode_for_size (bits, MODE_INT, 0);
delta = bits / BITS_PER_UNIT;
/* Allocate a buffer for the temporary registers. */
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
regs = XALLOCAVEC (rtx, length / delta);
/* Load as many BITS-sized chunks as possible. Use a normal load if
the source has enough alignment, otherwise use left/right pairs. */
for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++)
1992-02-06 21:09:50 +01:00
{
regs[i] = gen_reg_rtx (mode);
if (MEM_ALIGN (src) >= bits)
mips_emit_move (regs[i], adjust_address (src, mode, offset));
else
{
rtx part = adjust_address (src, BLKmode, offset);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!mips_expand_ext_as_unaligned_load (regs[i], part, bits, 0))
gcc_unreachable ();
}
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
}
1992-02-06 21:09:50 +01:00
/* Copy the chunks to the destination. */
for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++)
if (MEM_ALIGN (dest) >= bits)
mips_emit_move (adjust_address (dest, mode, offset), regs[i]);
else
{
rtx part = adjust_address (dest, BLKmode, offset);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!mips_expand_ins_as_unaligned_store (part, regs[i], bits, 0))
gcc_unreachable ();
}
/* Mop up any left-over bytes. */
if (offset < length)
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
{
src = adjust_address (src, BLKmode, offset);
dest = adjust_address (dest, BLKmode, offset);
move_by_pieces (dest, src, length - offset,
MIN (MEM_ALIGN (src), MEM_ALIGN (dest)), 0);
1992-02-06 21:09:50 +01:00
}
}
/* Helper function for doing a loop-based block operation on memory
reference MEM. Each iteration of the loop will operate on LENGTH
bytes of MEM.
1992-02-06 21:09:50 +01:00
Create a new base register for use within the loop and point it to
the start of MEM. Create a new memory reference that uses this
register. Store them in *LOOP_REG and *LOOP_MEM respectively. */
static void
mips_adjust_block_mem (rtx mem, HOST_WIDE_INT length,
rtx *loop_reg, rtx *loop_mem)
{
*loop_reg = copy_addr_to_reg (XEXP (mem, 0));
/* Although the new mem does not refer to a known location,
it does keep up to LENGTH bytes of alignment. */
*loop_mem = change_address (mem, BLKmode, *loop_reg);
set_mem_align (*loop_mem, MIN (MEM_ALIGN (mem), length * BITS_PER_UNIT));
}
/* Move LENGTH bytes from SRC to DEST using a loop that moves BYTES_PER_ITER
bytes at a time. LENGTH must be at least BYTES_PER_ITER. Assume that
the memory regions do not overlap. */
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
static void
mips_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length,
HOST_WIDE_INT bytes_per_iter)
{
rtx label, src_reg, dest_reg, final_src;
HOST_WIDE_INT leftover;
leftover = length % bytes_per_iter;
length -= leftover;
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* Create registers and memory references for use within the loop. */
mips_adjust_block_mem (src, bytes_per_iter, &src_reg, &src);
mips_adjust_block_mem (dest, bytes_per_iter, &dest_reg, &dest);
2007-08-25 01:54:05 +02:00
/* Calculate the value that SRC_REG should have after the last iteration
of the loop. */
final_src = expand_simple_binop (Pmode, PLUS, src_reg, GEN_INT (length),
0, 0, OPTAB_WIDEN);
/* Emit the start of the loop. */
label = gen_label_rtx ();
emit_label (label);
/* Emit the loop body. */
mips_block_move_straight (dest, src, bytes_per_iter);
/* Move on to the next block. */
mips_emit_move (src_reg, plus_constant (src_reg, bytes_per_iter));
mips_emit_move (dest_reg, plus_constant (dest_reg, bytes_per_iter));
/* Emit the loop condition. */
if (Pmode == DImode)
emit_insn (gen_cmpdi (src_reg, final_src));
else
emit_insn (gen_cmpsi (src_reg, final_src));
emit_jump_insn (gen_bne (label));
/* Mop up any left-over bytes. */
if (leftover)
mips_block_move_straight (dest, src, leftover);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Expand a movmemsi instruction, which copies LENGTH bytes from
memory reference SRC to memory reference DEST. */
bool
mips_expand_block_move (rtx dest, rtx src, rtx length)
{
if (GET_CODE (length) == CONST_INT)
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
{
if (INTVAL (length) <= MIPS_MAX_MOVE_BYTES_STRAIGHT)
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
{
mips_block_move_straight (dest, src, INTVAL (length));
return true;
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
}
else if (optimize)
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
{
mips_block_move_loop (dest, src, INTVAL (length),
MIPS_MAX_MOVE_BYTES_PER_LOOP_ITER);
return true;
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
}
}
return false;
}
/* Expand a loop of synci insns for the address range [BEGIN, END). */
void
mips_expand_synci_loop (rtx begin, rtx end)
{
rtx inc, label, cmp, cmp_result;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Load INC with the cache line size (rdhwr INC,$1). */
inc = gen_reg_rtx (SImode);
emit_insn (gen_rdhwr (inc, const1_rtx));
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Loop back to here. */
label = gen_label_rtx ();
emit_label (label);
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
emit_insn (gen_synci (begin));
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
cmp = mips_force_binary (Pmode, GTU, begin, end);
mips_emit_binary (PLUS, begin, begin, inc);
1992-02-06 21:09:50 +01:00
cmp_result = gen_rtx_EQ (VOIDmode, cmp, const0_rtx);
emit_jump_insn (gen_condjump (cmp_result, label));
}
mips.md (UNSPEC_SYNC_NEW_OP_12, [...]): New define_constants. 2008-05-20 David Daney <ddaney@avtrex.com> * config/mips/mips.md (UNSPEC_SYNC_NEW_OP_12, UNSPEC_SYNC_OLD_OP_12, UNSPEC_SYNC_EXCHANGE_12): New define_constants. (UNSPEC_SYNC_EXCHANGE, UNSPEC_MEMORY_BARRIER, UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): Renumber. (optab, insn): Add 'plus' and 'minus' to define_code_attr. (atomic_hiqi_op): New define_code_iterator. (sync_compare_and_swap<mode>): Call mips_expand_atomic_qihi instead of mips_expand_compare_and_swap_12. (compare_and_swap_12): Use MIPS_COMPARE_AND_SWAP_12 instead of MIPS_COMPARE_AND_SWAP_12_0. Pass argument to MIPS_COMPARE_AND_SWAP_12. (sync_<optab><mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>, sync_new_nand<mode>): New define_expands for HI and QI mode operands. (sync_<optab>_12, sync_old_<optab>_12, sync_new_<optab>_12, sync_nand_12, sync_old_nand_12, sync_new_nand_12): New insns. (sync_lock_test_and_set<mode>): New define_expand for HI and QI modes. (test_and_set_12): New insn. (sync_old_add<mode>, sync_new_add<mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_old_nand<mode>, sync_new_nand<mode>, sync_lock_test_and_set<mode>): Add early clobber to operand 0 for SI and DI mode insns. * config/mips/mips-protos.h (mips_gen_fn_6, mips_gen_fn_5, mips_gen_fn_4): New typedefs. (mips_gen_fn_ptrs): Define new union type. (mips_expand_compare_and_swap_12): Remove declaration. (mips_expand_atomic_qihi): Declare function. * config/mips/mips.c (mips_expand_compare_and_swap_12): Rename to... (mips_expand_atomic_qihi): ... this. Use new generator function parameter. * config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): Add OPS parameter. (MIPS_COMPARE_AND_SWAP_12_0): Delete macro. (MIPS_COMPARE_AND_SWAP_12_ZERO_OP, MIPS_COMPARE_AND_SWAP_12_NONZERO_OP, MIPS_SYNC_OP_12, MIPS_SYNC_OP_12_NOT_NOP, MIPS_SYNC_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12, MIPS_SYNC_OLD_OP_12_NOT_NOP, MIPS_SYNC_OLD_OP_12_NOT_NOP_REG, MIPS_SYNC_OLD_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12_NOT_NOT_REG, MIPS_SYNC_NEW_OP_12, MIPS_SYNC_NEW_OP_12_NOT_NOP, MIPS_SYNC_NEW_OP_12_NOT_NOT, MIPS_SYNC_EXCHANGE_12, MIPS_SYNC_EXCHANGE_12_ZERO_OP, MIPS_SYNC_EXCHANGE_12_NONZERO_OP): New macros. From-SVN: r135684
2008-05-21 01:13:13 +02:00
/* Expand a QI or HI mode atomic memory operation.
GENERATOR contains a pointer to the gen_* function that generates
the SI mode underlying atomic operation using masks that we
calculate.
RESULT is the return register for the operation. Its value is NULL
if unused.
MEM is the location of the atomic access.
OLDVAL is the first operand for the operation.
NEWVAL is the optional second operand for the operation. Its value
is NULL if unused. */
void
mips.md (UNSPEC_SYNC_NEW_OP_12, [...]): New define_constants. 2008-05-20 David Daney <ddaney@avtrex.com> * config/mips/mips.md (UNSPEC_SYNC_NEW_OP_12, UNSPEC_SYNC_OLD_OP_12, UNSPEC_SYNC_EXCHANGE_12): New define_constants. (UNSPEC_SYNC_EXCHANGE, UNSPEC_MEMORY_BARRIER, UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): Renumber. (optab, insn): Add 'plus' and 'minus' to define_code_attr. (atomic_hiqi_op): New define_code_iterator. (sync_compare_and_swap<mode>): Call mips_expand_atomic_qihi instead of mips_expand_compare_and_swap_12. (compare_and_swap_12): Use MIPS_COMPARE_AND_SWAP_12 instead of MIPS_COMPARE_AND_SWAP_12_0. Pass argument to MIPS_COMPARE_AND_SWAP_12. (sync_<optab><mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>, sync_new_nand<mode>): New define_expands for HI and QI mode operands. (sync_<optab>_12, sync_old_<optab>_12, sync_new_<optab>_12, sync_nand_12, sync_old_nand_12, sync_new_nand_12): New insns. (sync_lock_test_and_set<mode>): New define_expand for HI and QI modes. (test_and_set_12): New insn. (sync_old_add<mode>, sync_new_add<mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_old_nand<mode>, sync_new_nand<mode>, sync_lock_test_and_set<mode>): Add early clobber to operand 0 for SI and DI mode insns. * config/mips/mips-protos.h (mips_gen_fn_6, mips_gen_fn_5, mips_gen_fn_4): New typedefs. (mips_gen_fn_ptrs): Define new union type. (mips_expand_compare_and_swap_12): Remove declaration. (mips_expand_atomic_qihi): Declare function. * config/mips/mips.c (mips_expand_compare_and_swap_12): Rename to... (mips_expand_atomic_qihi): ... this. Use new generator function parameter. * config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): Add OPS parameter. (MIPS_COMPARE_AND_SWAP_12_0): Delete macro. (MIPS_COMPARE_AND_SWAP_12_ZERO_OP, MIPS_COMPARE_AND_SWAP_12_NONZERO_OP, MIPS_SYNC_OP_12, MIPS_SYNC_OP_12_NOT_NOP, MIPS_SYNC_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12, MIPS_SYNC_OLD_OP_12_NOT_NOP, MIPS_SYNC_OLD_OP_12_NOT_NOP_REG, MIPS_SYNC_OLD_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12_NOT_NOT_REG, MIPS_SYNC_NEW_OP_12, MIPS_SYNC_NEW_OP_12_NOT_NOP, MIPS_SYNC_NEW_OP_12_NOT_NOT, MIPS_SYNC_EXCHANGE_12, MIPS_SYNC_EXCHANGE_12_ZERO_OP, MIPS_SYNC_EXCHANGE_12_NONZERO_OP): New macros. From-SVN: r135684
2008-05-21 01:13:13 +02:00
mips_expand_atomic_qihi (union mips_gen_fn_ptrs generator,
rtx result, rtx mem, rtx oldval, rtx newval)
{
rtx orig_addr, memsi_addr, memsi, shift, shiftsi, unshifted_mask;
mips.md (UNSPEC_SYNC_NEW_OP_12, [...]): New define_constants. 2008-05-20 David Daney <ddaney@avtrex.com> * config/mips/mips.md (UNSPEC_SYNC_NEW_OP_12, UNSPEC_SYNC_OLD_OP_12, UNSPEC_SYNC_EXCHANGE_12): New define_constants. (UNSPEC_SYNC_EXCHANGE, UNSPEC_MEMORY_BARRIER, UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): Renumber. (optab, insn): Add 'plus' and 'minus' to define_code_attr. (atomic_hiqi_op): New define_code_iterator. (sync_compare_and_swap<mode>): Call mips_expand_atomic_qihi instead of mips_expand_compare_and_swap_12. (compare_and_swap_12): Use MIPS_COMPARE_AND_SWAP_12 instead of MIPS_COMPARE_AND_SWAP_12_0. Pass argument to MIPS_COMPARE_AND_SWAP_12. (sync_<optab><mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>, sync_new_nand<mode>): New define_expands for HI and QI mode operands. (sync_<optab>_12, sync_old_<optab>_12, sync_new_<optab>_12, sync_nand_12, sync_old_nand_12, sync_new_nand_12): New insns. (sync_lock_test_and_set<mode>): New define_expand for HI and QI modes. (test_and_set_12): New insn. (sync_old_add<mode>, sync_new_add<mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_old_nand<mode>, sync_new_nand<mode>, sync_lock_test_and_set<mode>): Add early clobber to operand 0 for SI and DI mode insns. * config/mips/mips-protos.h (mips_gen_fn_6, mips_gen_fn_5, mips_gen_fn_4): New typedefs. (mips_gen_fn_ptrs): Define new union type. (mips_expand_compare_and_swap_12): Remove declaration. (mips_expand_atomic_qihi): Declare function. * config/mips/mips.c (mips_expand_compare_and_swap_12): Rename to... (mips_expand_atomic_qihi): ... this. Use new generator function parameter. * config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): Add OPS parameter. (MIPS_COMPARE_AND_SWAP_12_0): Delete macro. (MIPS_COMPARE_AND_SWAP_12_ZERO_OP, MIPS_COMPARE_AND_SWAP_12_NONZERO_OP, MIPS_SYNC_OP_12, MIPS_SYNC_OP_12_NOT_NOP, MIPS_SYNC_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12, MIPS_SYNC_OLD_OP_12_NOT_NOP, MIPS_SYNC_OLD_OP_12_NOT_NOP_REG, MIPS_SYNC_OLD_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12_NOT_NOT_REG, MIPS_SYNC_NEW_OP_12, MIPS_SYNC_NEW_OP_12_NOT_NOP, MIPS_SYNC_NEW_OP_12_NOT_NOT, MIPS_SYNC_EXCHANGE_12, MIPS_SYNC_EXCHANGE_12_ZERO_OP, MIPS_SYNC_EXCHANGE_12_NONZERO_OP): New macros. From-SVN: r135684
2008-05-21 01:13:13 +02:00
rtx unshifted_mask_reg, mask, inverted_mask, si_op;
rtx res = NULL;
enum machine_mode mode;
mode = GET_MODE (mem);
/* Compute the address of the containing SImode value. */
orig_addr = force_reg (Pmode, XEXP (mem, 0));
memsi_addr = mips_force_binary (Pmode, AND, orig_addr,
force_reg (Pmode, GEN_INT (-4)));
/* Create a memory reference for it. */
memsi = gen_rtx_MEM (SImode, memsi_addr);
set_mem_alias_set (memsi, ALIAS_SET_MEMORY_BARRIER);
MEM_VOLATILE_P (memsi) = MEM_VOLATILE_P (mem);
/* Work out the byte offset of the QImode or HImode value,
counting from the least significant byte. */
shift = mips_force_binary (Pmode, AND, orig_addr, GEN_INT (3));
if (TARGET_BIG_ENDIAN)
mips_emit_binary (XOR, shift, shift, GEN_INT (mode == QImode ? 3 : 2));
/* Multiply by eight to convert the shift value from bytes to bits. */
mips_emit_binary (ASHIFT, shift, shift, GEN_INT (3));
/* Make the final shift an SImode value, so that it can be used in
SImode operations. */
shiftsi = force_reg (SImode, gen_lowpart (SImode, shift));
/* Set MASK to an inclusive mask of the QImode or HImode value. */
unshifted_mask = GEN_INT (GET_MODE_MASK (mode));
unshifted_mask_reg = force_reg (SImode, unshifted_mask);
mask = mips_force_binary (SImode, ASHIFT, unshifted_mask_reg, shiftsi);
/* Compute the equivalent exclusive mask. */
inverted_mask = gen_reg_rtx (SImode);
emit_insn (gen_rtx_SET (VOIDmode, inverted_mask,
gen_rtx_NOT (SImode, mask)));
/* Shift the old value into place. */
if (oldval != const0_rtx)
{
oldval = convert_modes (SImode, mode, oldval, true);
oldval = force_reg (SImode, oldval);
oldval = mips_force_binary (SImode, ASHIFT, oldval, shiftsi);
}
/* Do the same for the new value. */
mips.md (UNSPEC_SYNC_NEW_OP_12, [...]): New define_constants. 2008-05-20 David Daney <ddaney@avtrex.com> * config/mips/mips.md (UNSPEC_SYNC_NEW_OP_12, UNSPEC_SYNC_OLD_OP_12, UNSPEC_SYNC_EXCHANGE_12): New define_constants. (UNSPEC_SYNC_EXCHANGE, UNSPEC_MEMORY_BARRIER, UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): Renumber. (optab, insn): Add 'plus' and 'minus' to define_code_attr. (atomic_hiqi_op): New define_code_iterator. (sync_compare_and_swap<mode>): Call mips_expand_atomic_qihi instead of mips_expand_compare_and_swap_12. (compare_and_swap_12): Use MIPS_COMPARE_AND_SWAP_12 instead of MIPS_COMPARE_AND_SWAP_12_0. Pass argument to MIPS_COMPARE_AND_SWAP_12. (sync_<optab><mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>, sync_new_nand<mode>): New define_expands for HI and QI mode operands. (sync_<optab>_12, sync_old_<optab>_12, sync_new_<optab>_12, sync_nand_12, sync_old_nand_12, sync_new_nand_12): New insns. (sync_lock_test_and_set<mode>): New define_expand for HI and QI modes. (test_and_set_12): New insn. (sync_old_add<mode>, sync_new_add<mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_old_nand<mode>, sync_new_nand<mode>, sync_lock_test_and_set<mode>): Add early clobber to operand 0 for SI and DI mode insns. * config/mips/mips-protos.h (mips_gen_fn_6, mips_gen_fn_5, mips_gen_fn_4): New typedefs. (mips_gen_fn_ptrs): Define new union type. (mips_expand_compare_and_swap_12): Remove declaration. (mips_expand_atomic_qihi): Declare function. * config/mips/mips.c (mips_expand_compare_and_swap_12): Rename to... (mips_expand_atomic_qihi): ... this. Use new generator function parameter. * config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): Add OPS parameter. (MIPS_COMPARE_AND_SWAP_12_0): Delete macro. (MIPS_COMPARE_AND_SWAP_12_ZERO_OP, MIPS_COMPARE_AND_SWAP_12_NONZERO_OP, MIPS_SYNC_OP_12, MIPS_SYNC_OP_12_NOT_NOP, MIPS_SYNC_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12, MIPS_SYNC_OLD_OP_12_NOT_NOP, MIPS_SYNC_OLD_OP_12_NOT_NOP_REG, MIPS_SYNC_OLD_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12_NOT_NOT_REG, MIPS_SYNC_NEW_OP_12, MIPS_SYNC_NEW_OP_12_NOT_NOP, MIPS_SYNC_NEW_OP_12_NOT_NOT, MIPS_SYNC_EXCHANGE_12, MIPS_SYNC_EXCHANGE_12_ZERO_OP, MIPS_SYNC_EXCHANGE_12_NONZERO_OP): New macros. From-SVN: r135684
2008-05-21 01:13:13 +02:00
if (newval && newval != const0_rtx)
{
newval = convert_modes (SImode, mode, newval, true);
newval = force_reg (SImode, newval);
newval = mips_force_binary (SImode, ASHIFT, newval, shiftsi);
}
/* Do the SImode atomic access. */
mips.md (UNSPEC_SYNC_NEW_OP_12, [...]): New define_constants. 2008-05-20 David Daney <ddaney@avtrex.com> * config/mips/mips.md (UNSPEC_SYNC_NEW_OP_12, UNSPEC_SYNC_OLD_OP_12, UNSPEC_SYNC_EXCHANGE_12): New define_constants. (UNSPEC_SYNC_EXCHANGE, UNSPEC_MEMORY_BARRIER, UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): Renumber. (optab, insn): Add 'plus' and 'minus' to define_code_attr. (atomic_hiqi_op): New define_code_iterator. (sync_compare_and_swap<mode>): Call mips_expand_atomic_qihi instead of mips_expand_compare_and_swap_12. (compare_and_swap_12): Use MIPS_COMPARE_AND_SWAP_12 instead of MIPS_COMPARE_AND_SWAP_12_0. Pass argument to MIPS_COMPARE_AND_SWAP_12. (sync_<optab><mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>, sync_new_nand<mode>): New define_expands for HI and QI mode operands. (sync_<optab>_12, sync_old_<optab>_12, sync_new_<optab>_12, sync_nand_12, sync_old_nand_12, sync_new_nand_12): New insns. (sync_lock_test_and_set<mode>): New define_expand for HI and QI modes. (test_and_set_12): New insn. (sync_old_add<mode>, sync_new_add<mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_old_nand<mode>, sync_new_nand<mode>, sync_lock_test_and_set<mode>): Add early clobber to operand 0 for SI and DI mode insns. * config/mips/mips-protos.h (mips_gen_fn_6, mips_gen_fn_5, mips_gen_fn_4): New typedefs. (mips_gen_fn_ptrs): Define new union type. (mips_expand_compare_and_swap_12): Remove declaration. (mips_expand_atomic_qihi): Declare function. * config/mips/mips.c (mips_expand_compare_and_swap_12): Rename to... (mips_expand_atomic_qihi): ... this. Use new generator function parameter. * config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): Add OPS parameter. (MIPS_COMPARE_AND_SWAP_12_0): Delete macro. (MIPS_COMPARE_AND_SWAP_12_ZERO_OP, MIPS_COMPARE_AND_SWAP_12_NONZERO_OP, MIPS_SYNC_OP_12, MIPS_SYNC_OP_12_NOT_NOP, MIPS_SYNC_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12, MIPS_SYNC_OLD_OP_12_NOT_NOP, MIPS_SYNC_OLD_OP_12_NOT_NOP_REG, MIPS_SYNC_OLD_OP_12_NOT_NOT, MIPS_SYNC_OLD_OP_12_NOT_NOT_REG, MIPS_SYNC_NEW_OP_12, MIPS_SYNC_NEW_OP_12_NOT_NOP, MIPS_SYNC_NEW_OP_12_NOT_NOT, MIPS_SYNC_EXCHANGE_12, MIPS_SYNC_EXCHANGE_12_ZERO_OP, MIPS_SYNC_EXCHANGE_12_NONZERO_OP): New macros. From-SVN: r135684
2008-05-21 01:13:13 +02:00
if (result)
res = gen_reg_rtx (SImode);
if (newval)
si_op = generator.fn_6 (res, memsi, mask, inverted_mask, oldval, newval);
else if (result)
si_op = generator.fn_5 (res, memsi, mask, inverted_mask, oldval);
else
si_op = generator.fn_4 (memsi, mask, inverted_mask, oldval);
emit_insn (si_op);
if (result)
{
/* Shift and convert the result. */
mips_emit_binary (AND, res, res, mask);
mips_emit_binary (LSHIFTRT, res, res, shiftsi);
mips_emit_move (result, gen_lowpart (GET_MODE (result), res));
}
}
/* Return true if it is possible to use left/right accesses for a
bitfield of WIDTH bits starting BITPOS bits into *OP. When
returning true, update *OP, *LEFT and *RIGHT as follows:
1992-02-06 21:09:50 +01:00
*OP is a BLKmode reference to the whole field.
1992-02-06 21:09:50 +01:00
*LEFT is a QImode reference to the first byte if big endian or
the last byte if little endian. This address can be used in the
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
left-side instructions (LWL, SWL, LDL, SDL).
1992-02-06 21:09:50 +01:00
*RIGHT is a QImode reference to the opposite end of the field and
can be used in the patterning right-side instruction. */
1992-02-06 21:09:50 +01:00
static bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_get_unaligned_mem (rtx *op, HOST_WIDE_INT width, HOST_WIDE_INT bitpos,
rtx *left, rtx *right)
{
rtx first, last;
/* Check that the operand really is a MEM. Not all the extv and
extzv predicates are checked. */
if (!MEM_P (*op))
return false;
1992-02-06 21:09:50 +01:00
/* Check that the size is valid. */
if (width != 32 && (!TARGET_64BIT || width != 64))
return false;
1992-02-06 21:09:50 +01:00
/* We can only access byte-aligned values. Since we are always passed
a reference to the first byte of the field, it is not necessary to
do anything with BITPOS after this check. */
if (bitpos % BITS_PER_UNIT != 0)
return false;
/* Reject aligned bitfields: we want to use a normal load or store
instead of a left/right pair. */
if (MEM_ALIGN (*op) >= width)
return false;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Adjust *OP to refer to the whole field. This also has the effect
of legitimizing *OP's address for BLKmode, possibly simplifying it. */
*op = adjust_address (*op, BLKmode, 0);
set_mem_size (*op, GEN_INT (width / BITS_PER_UNIT));
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Get references to both ends of the field. We deliberately don't
use the original QImode *OP for FIRST since the new BLKmode one
might have a simpler address. */
first = adjust_address (*op, QImode, 0);
last = adjust_address (*op, QImode, width / BITS_PER_UNIT - 1);
1992-02-06 21:09:50 +01:00
/* Allocate to LEFT and RIGHT according to endianness. LEFT should
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
correspond to the MSB and RIGHT to the LSB. */
if (TARGET_BIG_ENDIAN)
*left = first, *right = last;
else
*left = last, *right = first;
1992-02-06 21:09:50 +01:00
return true;
}
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Try to use left/right loads to expand an "extv" or "extzv" pattern.
DEST, SRC, WIDTH and BITPOS are the operands passed to the expander;
the operation is the equivalent of:
(set DEST (*_extract SRC WIDTH BITPOS))
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
Return true on success. */
1992-02-06 21:09:50 +01:00
bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_ext_as_unaligned_load (rtx dest, rtx src, HOST_WIDE_INT width,
HOST_WIDE_INT bitpos)
{
rtx left, right, temp;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If TARGET_64BIT, the destination of a 32-bit "extz" or "extzv" will
be a paradoxical word_mode subreg. This is the only case in which
we allow the destination to be larger than the source. */
if (GET_CODE (dest) == SUBREG
&& GET_MODE (dest) == DImode
&& GET_MODE (SUBREG_REG (dest)) == SImode)
dest = SUBREG_REG (dest);
/* After the above adjustment, the destination must be the same
width as the source. */
if (GET_MODE_BITSIZE (GET_MODE (dest)) != width)
return false;
if (!mips_get_unaligned_mem (&src, width, bitpos, &left, &right))
return false;
temp = gen_reg_rtx (GET_MODE (dest));
if (GET_MODE (dest) == DImode)
{
emit_insn (gen_mov_ldl (temp, src, left));
emit_insn (gen_mov_ldr (dest, copy_rtx (src), right, temp));
}
else
{
emit_insn (gen_mov_lwl (temp, src, left));
emit_insn (gen_mov_lwr (dest, copy_rtx (src), right, temp));
1992-02-06 21:09:50 +01:00
}
return true;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Try to use left/right stores to expand an "ins" pattern. DEST, WIDTH,
BITPOS and SRC are the operands passed to the expander; the operation
is the equivalent of:
(set (zero_extract DEST WIDTH BITPOS) SRC)
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
Return true on success. */
bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_ins_as_unaligned_store (rtx dest, rtx src, HOST_WIDE_INT width,
HOST_WIDE_INT bitpos)
{
rtx left, right;
enum machine_mode mode;
if (!mips_get_unaligned_mem (&dest, width, bitpos, &left, &right))
return false;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
mode = mode_for_size (width, MODE_INT, 0);
src = gen_lowpart (mode, src);
if (mode == DImode)
{
emit_insn (gen_mov_sdl (dest, src, left));
emit_insn (gen_mov_sdr (copy_rtx (dest), copy_rtx (src), right));
}
else
{
emit_insn (gen_mov_swl (dest, src, left));
emit_insn (gen_mov_swr (copy_rtx (dest), copy_rtx (src), right));
}
return true;
}
/* Return true if X is a MEM with the same size as MODE. */
bool
mips_mem_fits_mode_p (enum machine_mode mode, rtx x)
{
rtx size;
if (!MEM_P (x))
return false;
size = MEM_SIZE (x);
return size && INTVAL (size) == GET_MODE_SIZE (mode);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if (zero_extract OP WIDTH BITPOS) can be used as the
source of an "ext" instruction or the destination of an "ins"
instruction. OP must be a register operand and the following
conditions must hold:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
0 <= BITPOS < GET_MODE_BITSIZE (GET_MODE (op))
0 < WIDTH <= GET_MODE_BITSIZE (GET_MODE (op))
0 < BITPOS + WIDTH <= GET_MODE_BITSIZE (GET_MODE (op))
Also reject lengths equal to a word as they are better handled
by the move patterns. */
bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_use_ins_ext_p (rtx op, HOST_WIDE_INT width, HOST_WIDE_INT bitpos)
{
if (!ISA_HAS_EXT_INS
|| !register_operand (op, VOIDmode)
|| GET_MODE_BITSIZE (GET_MODE (op)) > BITS_PER_WORD)
return false;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!IN_RANGE (width, 1, GET_MODE_BITSIZE (GET_MODE (op)) - 1))
return false;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (bitpos < 0 || bitpos + width > GET_MODE_BITSIZE (GET_MODE (op)))
return false;
return true;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if -msplit-addresses is selected and should be honored.
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
-msplit-addresses is a half-way house between explicit relocations
and the traditional assembler macros. It can split absolute 32-bit
symbolic constants into a high/lo_sum pair but uses macros for other
sorts of access.
Like explicit relocation support for REL targets, it relies
on GNU extensions in the assembler and the linker.
Although this code should work for -O0, it has traditionally
been treated as an optimization. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
static bool
mips_split_addresses_p (void)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return (TARGET_SPLIT_ADDRESSES
&& optimize
&& !TARGET_MIPS16
&& !flag_pic
&& !ABI_HAS_64BIT_SYMBOLS);
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* (Re-)Initialize mips_split_p, mips_lo_relocs and mips_hi_relocs. */
static void
mips_init_relocs (void)
{
memset (mips_split_p, '\0', sizeof (mips_split_p));
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
memset (mips_split_hi_p, '\0', sizeof (mips_split_hi_p));
memset (mips_hi_relocs, '\0', sizeof (mips_hi_relocs));
memset (mips_lo_relocs, '\0', sizeof (mips_lo_relocs));
if (ABI_HAS_64BIT_SYMBOLS)
{
if (TARGET_EXPLICIT_RELOCS)
{
mips_split_p[SYMBOL_64_HIGH] = true;
mips_hi_relocs[SYMBOL_64_HIGH] = "%highest(";
mips_lo_relocs[SYMBOL_64_HIGH] = "%higher(";
mips_split_p[SYMBOL_64_MID] = true;
mips_hi_relocs[SYMBOL_64_MID] = "%higher(";
mips_lo_relocs[SYMBOL_64_MID] = "%hi(";
mips_split_p[SYMBOL_64_LOW] = true;
mips_hi_relocs[SYMBOL_64_LOW] = "%hi(";
mips_lo_relocs[SYMBOL_64_LOW] = "%lo(";
mips_split_p[SYMBOL_ABSOLUTE] = true;
mips_lo_relocs[SYMBOL_ABSOLUTE] = "%lo(";
}
}
else
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TARGET_EXPLICIT_RELOCS || mips_split_addresses_p () || TARGET_MIPS16)
{
mips_split_p[SYMBOL_ABSOLUTE] = true;
mips_hi_relocs[SYMBOL_ABSOLUTE] = "%hi(";
mips_lo_relocs[SYMBOL_ABSOLUTE] = "%lo(";
mips_lo_relocs[SYMBOL_32_HIGH] = "%hi(";
}
}
if (TARGET_MIPS16)
{
/* The high part is provided by a pseudo copy of $gp. */
mips_split_p[SYMBOL_GP_RELATIVE] = true;
mips_lo_relocs[SYMBOL_GP_RELATIVE] = "%gprel(";
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
else if (TARGET_EXPLICIT_RELOCS)
/* Small data constants are kept whole until after reload,
then lowered by mips_rewrite_small_data. */
mips_lo_relocs[SYMBOL_GP_RELATIVE] = "%gp_rel(";
if (TARGET_EXPLICIT_RELOCS)
{
mips_split_p[SYMBOL_GOT_PAGE_OFST] = true;
if (TARGET_NEWABI)
{
mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got_page(";
mips_lo_relocs[SYMBOL_GOT_PAGE_OFST] = "%got_ofst(";
}
else
{
mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got(";
mips_lo_relocs[SYMBOL_GOT_PAGE_OFST] = "%lo(";
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_MIPS16)
/* Expose the use of $28 as soon as possible. */
mips_split_hi_p[SYMBOL_GOT_PAGE_OFST] = true;
1992-02-06 21:09:50 +01:00
if (TARGET_XGOT)
{
/* The HIGH and LO_SUM are matched by special .md patterns. */
mips_split_p[SYMBOL_GOT_DISP] = true;
1992-02-06 21:09:50 +01:00
mips_split_p[SYMBOL_GOTOFF_DISP] = true;
mips_hi_relocs[SYMBOL_GOTOFF_DISP] = "%got_hi(";
mips_lo_relocs[SYMBOL_GOTOFF_DISP] = "%got_lo(";
mips_split_p[SYMBOL_GOTOFF_CALL] = true;
mips_hi_relocs[SYMBOL_GOTOFF_CALL] = "%call_hi(";
mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call_lo(";
}
else
{
if (TARGET_NEWABI)
mips_lo_relocs[SYMBOL_GOTOFF_DISP] = "%got_disp(";
else
mips_lo_relocs[SYMBOL_GOTOFF_DISP] = "%got(";
mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call16(";
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_MIPS16)
/* Expose the use of $28 as soon as possible. */
mips_split_p[SYMBOL_GOT_DISP] = true;
}
}
if (TARGET_NEWABI)
{
mips_split_p[SYMBOL_GOTOFF_LOADGP] = true;
mips_hi_relocs[SYMBOL_GOTOFF_LOADGP] = "%hi(%neg(%gp_rel(";
mips_lo_relocs[SYMBOL_GOTOFF_LOADGP] = "%lo(%neg(%gp_rel(";
}
mips_lo_relocs[SYMBOL_TLSGD] = "%tlsgd(";
mips_lo_relocs[SYMBOL_TLSLDM] = "%tlsldm(";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_split_p[SYMBOL_DTPREL] = true;
mips_hi_relocs[SYMBOL_DTPREL] = "%dtprel_hi(";
mips_lo_relocs[SYMBOL_DTPREL] = "%dtprel_lo(";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_lo_relocs[SYMBOL_GOTTPREL] = "%gottprel(";
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_split_p[SYMBOL_TPREL] = true;
mips_hi_relocs[SYMBOL_TPREL] = "%tprel_hi(";
mips_lo_relocs[SYMBOL_TPREL] = "%tprel_lo(";
1992-02-06 21:09:50 +01:00
mips_lo_relocs[SYMBOL_HALF] = "%half(";
1992-02-06 21:09:50 +01:00
}
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
/* If OP is an UNSPEC address, return the address to which it refers,
otherwise return OP itself. */
static rtx
mips_strip_unspec_address (rtx op)
{
rtx base, offset;
split_const (op, &base, &offset);
if (UNSPEC_ADDRESS_P (base))
op = plus_constant (UNSPEC_ADDRESS (base), INTVAL (offset));
return op;
}
/* Print symbolic operand OP, which is part of a HIGH or LO_SUM
in context CONTEXT. RELOCS is the array of relocations to use. */
static void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand_reloc (FILE *file, rtx op, enum mips_symbol_context context,
const char **relocs)
{
enum mips_symbol_type symbol_type;
const char *p;
symbol_type = mips_classify_symbolic_expression (op, context);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
gcc_assert (relocs[symbol_type]);
fputs (relocs[symbol_type], file);
output_addr_const (file, mips_strip_unspec_address (op));
for (p = relocs[symbol_type]; *p != 0; p++)
if (*p == '(')
fputc (')', file);
}
/* Print the text for PRINT_OPERAND punctation character CH to FILE.
The punctuation characters are:
'(' Start a nested ".set noreorder" block.
')' End a nested ".set noreorder" block.
'[' Start a nested ".set noat" block.
']' End a nested ".set noat" block.
'<' Start a nested ".set nomacro" block.
'>' End a nested ".set nomacro" block.
'*' Behave like %(%< if generating a delayed-branch sequence.
'#' Print a nop if in a ".set noreorder" block.
'/' Like '#', but do nothing within a delayed-branch sequence.
'?' Print "l" if mips_branch_likely is true
'.' Print the name of the register with a hard-wired zero (zero or $0).
'@' Print the name of the assembler temporary register (at or $1).
'^' Print the name of the pic call-through register (t9 or $25).
mips.h (GLOBAL_POINTER_REGNUM): New macro. * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for n32/64 PIC. (MUST_SAVE_REGISTERS): Delete. * config/mips/mips.c (mips_frame_info): Remove extra_size field. (machine_function): Add global_pointer field. (mips_classify_constant): Check for (const $gp) using pointer equality with pic_offset_table_rtx. (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_restore_gp): Use current_function_outgoing_args_size. (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of GP_REG_FIRST + 28. Handle relocation strings that have more than one '('. (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_global_pointer): New function. (mips_save_reg_p): New function, mostly split out from... (compute_frame_size): ...here. Remove handling of extra_size. Reclaim args_size if no variables depend on it. Don't treat gp as a special case: handle it in the main GPR loop. (mips_initial_elimination_offset): Fix comment. (save_restore_insns): Save every register in the GPR mask, removing distinction between mask and real_mask. (mips_output_function_prologue): Update .frame psuedo-op after the removal of extra_size. Move the SVR4 PIC stack allocation and cprestore instructions to mips_expand_prologue. (mips_gp_insn): New function. (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to the chosen global pointer. Handle SVR4 PIC stack allocation in the same way as other ABIs. Adjust varargs code accordingly. Emit a cprestore insn after allocating the stack. Use mips_gp_insn to emit the loadgp sequence. Follow it with a loadgp_blockage if not using explicit relocs. (mips_output_function_epilogue): Reinstate the default gp register. (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. (mips16_optimize_gp): Likewise. * config/mips/mips.md (UNSPEC_LOADGP): Remove. (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. (loadgp): Remove. (loadgp_blockage, cprestore): New instructions. (builtin_setjmp_setup): Implement using emit_move_insn. Use pic_offset_table_rtx. (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. (builtin_longjmp): Use gen_raw_REG to force use of $28. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r67656
2003-06-09 09:19:14 +02:00
'+' Print the name of the gp register (usually gp or $28).
'$' Print the name of the stack pointer register (sp or $29).
'|' Print ".set push; .set mips2" if !ISA_HAS_LL_SC.
'-' Print ".set pop" under the same conditions for '|'.
1992-02-06 21:09:50 +01:00
See also mips_init_print_operand_pucnt. */
1992-02-06 21:09:50 +01:00
static void
mips_print_operand_punctuation (FILE *file, int ch)
{
switch (ch)
1992-02-06 21:09:50 +01:00
{
case '(':
if (set_noreorder++ == 0)
fputs (".set\tnoreorder\n\t", file);
break;
1992-02-06 21:09:50 +01:00
case ')':
gcc_assert (set_noreorder > 0);
if (--set_noreorder == 0)
fputs ("\n\t.set\treorder", file);
break;
1992-02-06 21:09:50 +01:00
case '[':
if (set_noat++ == 0)
fputs (".set\tnoat\n\t", file);
break;
case ']':
gcc_assert (set_noat > 0);
if (--set_noat == 0)
fputs ("\n\t.set\tat", file);
break;
1992-02-06 21:09:50 +01:00
case '<':
if (set_nomacro++ == 0)
fputs (".set\tnomacro\n\t", file);
break;
case '>':
gcc_assert (set_nomacro > 0);
if (--set_nomacro == 0)
fputs ("\n\t.set\tmacro", file);
break;
case '*':
if (final_sequence != 0)
{
mips_print_operand_punctuation (file, '(');
mips_print_operand_punctuation (file, '<');
}
break;
1992-02-06 21:09:50 +01:00
case '#':
if (set_noreorder != 0)
fputs ("\n\tnop", file);
break;
1992-02-06 21:09:50 +01:00
case '/':
/* Print an extra newline so that the delayed insn is separated
from the following ones. This looks neater and is consistent
with non-nop delayed sequences. */
if (set_noreorder != 0 && final_sequence == 0)
fputs ("\n\tnop\n", file);
break;
1992-02-06 21:09:50 +01:00
case '?':
if (mips_branch_likely)
putc ('l', file);
break;
1992-02-06 21:09:50 +01:00
case '.':
fputs (reg_names[GP_REG_FIRST + 0], file);
break;
1992-02-06 21:09:50 +01:00
case '@':
fputs (reg_names[GP_REG_FIRST + 1], file);
break;
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
case '^':
fputs (reg_names[PIC_FUNCTION_ADDR_REGNUM], file);
break;
1992-02-06 21:09:50 +01:00
case '+':
fputs (reg_names[PIC_OFFSET_TABLE_REGNUM], file);
break;
1992-02-06 21:09:50 +01:00
case '$':
fputs (reg_names[STACK_POINTER_REGNUM], file);
break;
1992-02-06 21:09:50 +01:00
case '|':
if (!ISA_HAS_LL_SC)
fputs (".set\tpush\n\t.set\tmips2\n\t", file);
break;
1992-02-06 21:09:50 +01:00
case '-':
if (!ISA_HAS_LL_SC)
fputs ("\n\t.set\tpop", file);
break;
1992-02-06 21:09:50 +01:00
default:
gcc_unreachable ();
break;
}
}
1992-02-06 21:09:50 +01:00
/* Initialize mips_print_operand_punct. */
1992-02-06 21:09:50 +01:00
static void
mips_init_print_operand_punct (void)
{
const char *p;
1992-02-06 21:09:50 +01:00
for (p = "()[]<>*#/?.@^+$|-"; *p; p++)
mips_print_operand_punct[(unsigned char) *p] = true;
}
1992-02-06 21:09:50 +01:00
/* PRINT_OPERAND prefix LETTER refers to the integer branch instruction
associated with condition CODE. Print the condition part of the
opcode to FILE. */
1992-02-06 21:09:50 +01:00
static void
mips_print_int_branch_condition (FILE *file, enum rtx_code code, int letter)
{
switch (code)
{
case EQ:
case NE:
case GT:
case GE:
case LT:
case LE:
case GTU:
case GEU:
case LTU:
case LEU:
/* Conveniently, the MIPS names for these conditions are the same
as their RTL equivalents. */
fputs (GET_RTX_NAME (code), file);
break;
1992-02-06 21:09:50 +01:00
default:
output_operand_lossage ("'%%%c' is not a valid operand prefix", letter);
break;
}
}
1992-02-06 21:09:50 +01:00
/* Likewise floating-point branches. */
static void
mips_print_float_branch_condition (FILE *file, enum rtx_code code, int letter)
{
switch (code)
{
case EQ:
fputs ("c1f", file);
break;
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
case NE:
fputs ("c1t", file);
break;
default:
output_operand_lossage ("'%%%c' is not a valid operand prefix", letter);
break;
}
}
/* Implement the PRINT_OPERAND macro. The MIPS-specific operand codes are:
'X' Print CONST_INT OP in hexadecimal format.
'x' Print the low 16 bits of CONST_INT OP in hexadecimal format.
'd' Print CONST_INT OP in decimal.
'h' Print the high-part relocation associated with OP, after stripping
any outermost HIGH.
'R' Print the low-part relocation associated with OP.
'C' Print the integer branch condition for comparison OP.
'N' Print the inverse of the integer branch condition for comparison OP.
'F' Print the FPU branch condition for comparison OP.
'W' Print the inverse of the FPU branch condition for comparison OP.
'T' Print 'f' for (eq:CC ...), 't' for (ne:CC ...),
'z' for (eq:?I ...), 'n' for (ne:?I ...).
't' Like 'T', but with the EQ/NE cases reversed
'Y' Print mips_fp_conditions[INTVAL (OP)]
'Z' Print OP and a comma for ISA_HAS_8CC, otherwise print nothing.
'q' Print a DSP accumulator register.
'D' Print the second part of a double-word register or memory operand.
'L' Print the low-order register in a double-word register operand.
'M' Print high-order register in a double-word register operand.
'z' Print $0 if OP is zero, otherwise print OP normally. */
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand (FILE *file, rtx op, int letter)
{
enum rtx_code code;
1992-02-06 21:09:50 +01:00
if (PRINT_OPERAND_PUNCT_VALID_P (letter))
1992-02-06 21:09:50 +01:00
{
mips_print_operand_punctuation (file, letter);
1992-02-06 21:09:50 +01:00
return;
}
gcc_assert (op);
1992-02-06 21:09:50 +01:00
code = GET_CODE (op);
switch (letter)
{
case 'X':
if (GET_CODE (op) == CONST_INT)
fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (op));
else
output_operand_lossage ("invalid use of '%%%c'", letter);
break;
1992-02-06 21:09:50 +01:00
case 'x':
if (GET_CODE (op) == CONST_INT)
fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (op) & 0xffff);
else
output_operand_lossage ("invalid use of '%%%c'", letter);
break;
case 'd':
if (GET_CODE (op) == CONST_INT)
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (op));
else
output_operand_lossage ("invalid use of '%%%c'", letter);
break;
case 'h':
if (code == HIGH)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
op = XEXP (op, 0);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand_reloc (file, op, SYMBOL_CONTEXT_LEA, mips_hi_relocs);
break;
case 'R':
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand_reloc (file, op, SYMBOL_CONTEXT_LEA, mips_lo_relocs);
break;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case 'C':
mips_print_int_branch_condition (file, code, letter);
break;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case 'N':
mips_print_int_branch_condition (file, reverse_condition (code), letter);
break;
case 'F':
mips_print_float_branch_condition (file, code, letter);
break;
case 'W':
mips_print_float_branch_condition (file, reverse_condition (code),
letter);
break;
case 'T':
case 't':
{
int truth = (code == NE) == (letter == 'T');
fputc ("zfnt"[truth * 2 + (GET_MODE (op) == CCmode)], file);
}
break;
case 'Y':
if (code == CONST_INT && UINTVAL (op) < ARRAY_SIZE (mips_fp_conditions))
fputs (mips_fp_conditions[UINTVAL (op)], file);
else
output_operand_lossage ("'%%%c' is not a valid operand prefix",
letter);
break;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
case 'Z':
if (ISA_HAS_8CC)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand (file, op, 0);
fputc (',', file);
}
break;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
case 'q':
if (code == REG && MD_REG_P (REGNO (op)))
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
fprintf (file, "$ac0");
else if (code == REG && DSP_ACC_REG_P (REGNO (op)))
fprintf (file, "$ac%c", reg_names[REGNO (op)][3]);
else
output_operand_lossage ("invalid use of '%%%c'", letter);
break;
1992-02-06 21:09:50 +01:00
default:
switch (code)
{
case REG:
{
unsigned int regno = REGNO (op);
if ((letter == 'M' && TARGET_LITTLE_ENDIAN)
|| (letter == 'L' && TARGET_BIG_ENDIAN)
|| letter == 'D')
regno++;
fprintf (file, "%s", reg_names[regno]);
}
break;
1992-02-06 21:09:50 +01:00
case MEM:
if (letter == 'D')
output_address (plus_constant (XEXP (op, 0), 4));
else
output_address (XEXP (op, 0));
break;
1992-02-06 21:09:50 +01:00
default:
if (letter == 'z' && op == CONST0_RTX (GET_MODE (op)))
fputs (reg_names[GP_REG_FIRST], file);
else if (CONST_GP_P (op))
fputs (reg_names[GLOBAL_POINTER_REGNUM], file);
else
output_addr_const (file, mips_strip_unspec_address (op));
break;
}
}
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
}
/* Output address operand X to FILE. */
1992-02-06 21:09:50 +01:00
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand_address (FILE *file, rtx x)
{
struct mips_address_info addr;
1992-02-06 21:09:50 +01:00
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (mips_classify_address (&addr, x, word_mode, true))
switch (addr.type)
{
case ADDRESS_REG:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand (file, addr.offset, 0);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]);
return;
case ADDRESS_LO_SUM:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_print_operand_reloc (file, addr.offset, SYMBOL_CONTEXT_MEM,
mips_lo_relocs);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]);
return;
case ADDRESS_CONST_INT:
output_addr_const (file, x);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fprintf (file, "(%s)", reg_names[GP_REG_FIRST]);
return;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
case ADDRESS_SYMBOLIC:
invoke.texi (-mcode-readable): Document. gcc/ 2007-08-08 Richard Sandiford <richard@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Chao-ying Fu <fu@mips.com> Nigel Stephens <nigel@mips.com> David Ung <davidu@mips.com> * doc/invoke.texi (-mcode-readable): Document. * config/mips/mips.opt (mcode-readable): New option. * config/mips/mips-protos.h (SYMBOL_32_HIGH): New symbol type. * config/mips/mips.h (mips_code_readable_setting): New enum. (mips_code_readable): Declare. (TARGET_MIPS16_TEXT_LOADS, TARGET_MIPS16_PCREL_LOADS): New macros. (TARGET_MIPS16_SHORT_JUMP_TABLES): New macro. (JUMP_TABLES_IN_TEXT_SECTION): Use it. (CASE_VECTOR_MODE, CASE_VECTOR_PC_RELATIVE): Likewise. Remove boiler-plate comments. (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_MIPS16_SHORT_JUMP_TABLES. * config/mips/mips.c (mips_code_readable): New variable. (mips_classify_symbol): Only return SYMBOL_PC_RELATIVE for MIPS16 labels if TARGET_MIPS16_SHORT_JUMP_TABLES. Use both the context and -mcode-readable setting to restrict the use of SYMBOL_PC_RELATIVE for MIPS16 constant pool references. Only return TARGET_FORCE_TO_MEM if PC-relative loads are allowed. (mips_symbolic_constant_p): Handle SYMBOL_32_HIGH. (mips_blocks_for_constant_p): Only return false for TARGET_MIPS16_PCREL_LOADS. (mips_symbol_insns_1): Treat HIGHs as 2 extended instructions for MIPS16. Handle SYMBOL_32_HIGH. (mips_const_insns): Allow HIGHs for MIPS16 too. (mips_unspec_address_offset): New function, split out from... (mips_unspec_address): ...here. (mips_output_move): Handle MIPS16 HIGH moves. Use "li" to load 16-bit symbolic constants. Assert approropiate conditions for using the "la" and "dla" macros. (mips_handle_option): Handle -mcode-readable=. (override_options): Use %hi/%lo relocations for TARGET_MIPS16 too. Set up mips_lo_relocs[SYMBOL_32_HIGH]. (mips_strip_unspec_address): New function, split out from... (print_operand_reloc): ...here. (print_operand): Pass constants through mips_strip_unspec_address. (print_operand_address): Likewise. (mips_output_mi_thunk): Remove guard of mips16_lay_out_constants. (mips_select_rtx_section): Remove MIPS16 handling. (mips16_gp_pseudo_reg): Check currently_expanding_to_rtl. (mips16_rewrite_pool_refs): Wrap the labels in an address UNSPEC. (mips16_lay_out_constants): Do nothing unless TARGET_MIPS16_PCREL_LOADS. (mips_avoid_hazards): Remove guard of mips16_lay_out_constants. * config/mips/mips.md: Split HIGHs for MIPS16. (tablejump): Use TARGET_MIPS16_SHORT_JUMP_TABLES. gcc/testsuite/ * gcc.target/mips/code-readable-1.c: New test. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. Co-Authored-By: Chao-ying Fu <fu@mips.com> Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r127300
2007-08-08 17:57:48 +02:00
output_addr_const (file, mips_strip_unspec_address (x));
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
return;
}
gcc_unreachable ();
1992-02-06 21:09:50 +01: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
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_ENCODE_SECTION_INFO. */
static void
mips_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
if (TREE_CODE (decl) == FUNCTION_DECL)
{
rtx symbol = XEXP (rtl, 0);
tree type = TREE_TYPE (decl);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Encode whether the symbol is short or long. */
if ((TARGET_LONG_CALLS && !mips_near_type_p (type))
|| mips_far_type_p (type))
SYMBOL_REF_FLAGS (symbol) |= SYMBOL_FLAG_LONG_CALL;
}
}
/* Implement TARGET_SELECT_RTX_SECTION. */
static section *
mips_select_rtx_section (enum machine_mode mode, rtx x,
unsigned HOST_WIDE_INT align)
{
/* ??? Consider using mergeable small data sections. */
if (mips_rtx_constant_in_small_data_p (mode))
return get_named_section (NULL, ".sdata", 0);
return default_elf_select_rtx_section (mode, x, align);
}
/* Implement TARGET_ASM_FUNCTION_RODATA_SECTION.
The complication here is that, with the combination TARGET_ABICALLS
&& !TARGET_GPWORD, jump tables will use absolute addresses, and should
therefore not be included in the read-only part of a DSO. Handle such
cases by selecting a normal data section instead of a read-only one.
The logic apes that in default_function_rodata_section. */
static section *
mips_function_rodata_section (tree decl)
{
if (!TARGET_ABICALLS || TARGET_GPWORD)
return default_function_rodata_section (decl);
if (decl && DECL_SECTION_NAME (decl))
{
const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
if (DECL_ONE_ONLY (decl) && strncmp (name, ".gnu.linkonce.t.", 16) == 0)
{
char *rname = ASTRDUP (name);
rname[14] = 'd';
return get_section (rname, SECTION_LINKONCE | SECTION_WRITE, decl);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
else if (flag_function_sections
&& flag_data_sections
&& strncmp (name, ".text.", 6) == 0)
{
char *rname = ASTRDUP (name);
memcpy (rname + 1, "data", 4);
return get_section (rname, SECTION_WRITE, decl);
}
}
return data_section;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_IN_SMALL_DATA_P. */
static bool
mips_in_small_data_p (const_tree decl)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned HOST_WIDE_INT size;
if (TREE_CODE (decl) == STRING_CST || TREE_CODE (decl) == FUNCTION_DECL)
return false;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* We don't yet generate small-data references for -mabicalls
or VxWorks RTP code. See the related -G handling in
mips_override_options. */
if (TARGET_ABICALLS || TARGET_VXWORKS_RTP)
return false;
if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl) != 0)
{
const char *name;
/* Reject anything that isn't in a known small-data section. */
name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
if (strcmp (name, ".sdata") != 0 && strcmp (name, ".sbss") != 0)
return false;
/* If a symbol is defined externally, the assembler will use the
usual -G rules when deciding how to implement macros. */
if (mips_lo_relocs[SYMBOL_GP_RELATIVE] || !DECL_EXTERNAL (decl))
return true;
}
else if (TARGET_EMBEDDED_DATA)
{
/* Don't put constants into the small data section: we want them
to be in ROM rather than RAM. */
if (TREE_CODE (decl) != VAR_DECL)
return false;
if (TREE_READONLY (decl)
&& !TREE_SIDE_EFFECTS (decl)
&& (!DECL_INITIAL (decl) || TREE_CONSTANT (DECL_INITIAL (decl))))
return false;
}
/* Enforce -mlocal-sdata. */
if (!TARGET_LOCAL_SDATA && !TREE_PUBLIC (decl))
return false;
/* Enforce -mextern-sdata. */
if (!TARGET_EXTERN_SDATA && DECL_P (decl))
{
if (DECL_EXTERNAL (decl))
return false;
if (DECL_COMMON (decl) && DECL_INITIAL (decl) == NULL)
return false;
}
/* We have traditionally not treated zero-sized objects as small data,
so this is now effectively part of the ABI. */
size = int_size_in_bytes (TREE_TYPE (decl));
return size > 0 && size <= mips_small_data_threshold;
}
/* Implement TARGET_USE_ANCHORS_FOR_SYMBOL_P. We don't want to use
anchors for small data: the GP register acts as an anchor in that
case. We also don't want to use them for PC-relative accesses,
where the PC acts as an anchor. */
static bool
mips_use_anchors_for_symbol_p (const_rtx symbol)
{
switch (mips_classify_symbol (symbol, SYMBOL_CONTEXT_MEM))
{
case SYMBOL_PC_RELATIVE:
case SYMBOL_GP_RELATIVE:
return false;
default:
return default_use_anchors_for_symbol_p (symbol);
}
}
/* The MIPS debug format wants all automatic variables and arguments
to be in terms of the virtual frame pointer (stack pointer before
any adjustment in the function), while the MIPS 3.0 linker wants
the frame pointer to be the stack pointer after the initial
adjustment. So, we do the adjustment here. The arg pointer (which
is eliminated) points to the virtual frame pointer, while the frame
pointer (which may be eliminated) points to the stack pointer after
the initial adjustments. */
HOST_WIDE_INT
mips_debugger_offset (rtx addr, HOST_WIDE_INT offset)
{
rtx offset2 = const0_rtx;
rtx reg = eliminate_constant_term (addr, &offset2);
if (offset == 0)
offset = INTVAL (offset2);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (reg == stack_pointer_rtx
|| reg == frame_pointer_rtx
|| reg == hard_frame_pointer_rtx)
{
offset -= cfun->machine->frame.total_size;
if (reg == hard_frame_pointer_rtx)
offset += cfun->machine->frame.hard_frame_pointer_offset;
}
/* sdbout_parms does not want this to crash for unrecognized cases. */
#if 0
else if (reg != arg_pointer_rtx)
fatal_insn ("mips_debugger_offset called with non stack/frame/arg pointer",
addr);
#endif
return offset;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement ASM_OUTPUT_EXTERNAL. */
1992-02-06 21:09:50 +01:00
void
mips_output_external (FILE *file, tree decl, const char *name)
{
default_elf_asm_output_external (file, decl, name);
/* We output the name if and only if TREE_SYMBOL_REFERENCED is
set in order to avoid putting out names that are never really
used. */
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
{
if (!TARGET_EXPLICIT_RELOCS && mips_in_small_data_p (decl))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* When using assembler macros, emit .extern directives for
all small-data externs so that the assembler knows how
big they are.
In most cases it would be safe (though pointless) to emit
.externs for other symbols too. One exception is when an
object is within the -G limit but declared by the user to
be in a section other than .sbss or .sdata. */
fputs ("\t.extern\t", file);
assemble_name (file, name);
fprintf (file, ", " HOST_WIDE_INT_PRINT_DEC "\n",
int_size_in_bytes (TREE_TYPE (decl)));
}
else if (TARGET_IRIX
&& mips_abi == ABI_32
&& TREE_CODE (decl) == FUNCTION_DECL)
{
/* In IRIX 5 or IRIX 6 for the O32 ABI, we must output a
`.global name .text' directive for every used but
undefined function. If we don't, the linker may perform
an optimization (skipping over the insns that set $gp)
when it is unsafe. */
fputs ("\t.globl ", file);
assemble_name (file, name);
fputs (" .text\n", file);
}
}
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement ASM_OUTPUT_SOURCE_FILENAME. */
1992-02-06 21:09:50 +01:00
void
mips_output_filename (FILE *stream, const char *name)
1992-02-06 21:09:50 +01:00
{
/* If we are emitting DWARF-2, let dwarf2out handle the ".file"
directives. */
if (write_symbols == DWARF2_DEBUG)
return;
else if (mips_output_filename_first_time)
1992-02-06 21:09:50 +01:00
{
mips_output_filename_first_time = 0;
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
num_source_filenames += 1;
1992-02-06 21:09:50 +01:00
current_function_file = name;
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
fprintf (stream, "\t.file\t%d ", num_source_filenames);
output_quoted_string (stream, name);
putc ('\n', stream);
1992-02-06 21:09:50 +01:00
}
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
/* If we are emitting stabs, let dbxout.c handle this (except for
the mips_output_filename_first_time case). */
else if (write_symbols == DBX_DEBUG)
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
return;
1992-02-06 21:09:50 +01:00
else if (name != current_function_file
&& strcmp (name, current_function_file) != 0)
1992-02-06 21:09:50 +01:00
{
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
num_source_filenames += 1;
current_function_file = name;
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
fprintf (stream, "\t.file\t%d ", num_source_filenames);
output_quoted_string (stream, name);
putc ('\n', stream);
1992-02-06 21:09:50 +01:00
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_ASM_OUTPUT_DWARF_DTPREL. */
static void ATTRIBUTE_UNUSED
mips_output_dwarf_dtprel (FILE *file, int size, rtx x)
{
switch (size)
{
case 4:
fputs ("\t.dtprelword\t", file);
break;
case 8:
fputs ("\t.dtpreldword\t", file);
break;
default:
gcc_unreachable ();
}
output_addr_const (file, x);
fputs ("+0x8000", file);
}
/* Implement TARGET_DWARF_REGISTER_SPAN. */
static rtx
mips_dwarf_register_span (rtx reg)
{
rtx high, low;
enum machine_mode mode;
/* By default, GCC maps increasing register numbers to increasing
memory locations, but paired FPRs are always little-endian,
regardless of the prevailing endianness. */
mode = GET_MODE (reg);
if (FP_REG_P (REGNO (reg))
&& TARGET_BIG_ENDIAN
&& MAX_FPRS_PER_FMT > 1
&& GET_MODE_SIZE (mode) > UNITS_PER_FPREG)
{
gcc_assert (GET_MODE_SIZE (mode) == UNITS_PER_HWFPVALUE);
high = mips_subword (reg, true);
low = mips_subword (reg, false);
return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, high, low));
}
return NULL_RTX;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement ASM_OUTPUT_ASCII. */
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_output_ascii (FILE *stream, const char *string, size_t len)
{
size_t i;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
int cur_pos;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
cur_pos = 17;
fprintf (stream, "\t.ascii\t\"");
for (i = 0; i < len; i++)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
int c;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
c = (unsigned char) string[i];
if (ISPRINT (c))
{
if (c == '\\' || c == '\"')
{
putc ('\\', stream);
cur_pos++;
}
putc (c, stream);
cur_pos++;
}
else
{
fprintf (stream, "\\%03o", c);
cur_pos += 4;
}
if (cur_pos > 72 && i+1 < len)
{
cur_pos = 17;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
fprintf (stream, "\"\n\t.ascii\t\"");
}
}
fprintf (stream, "\"\n");
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Emit either a label, .comm, or .lcomm directive. When using assembler
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
macros, mark the symbol as written so that mips_asm_output_external
won't emit an .extern for it. STREAM is the output file, NAME is the
name of the symbol, INIT_STRING is the string that should be written
before the symbol and FINAL_STRING is the string that should be
written after it. FINAL_STRING is a printf format that consumes the
remaining arguments. */
void
mips_declare_object (FILE *stream, const char *name, const char *init_string,
const char *final_string, ...)
{
va_list ap;
fputs (init_string, stream);
assemble_name (stream, name);
va_start (ap, final_string);
vfprintf (stream, final_string, ap);
va_end (ap);
if (!TARGET_EXPLICIT_RELOCS)
{
tree name_tree = get_identifier (name);
TREE_ASM_WRITTEN (name_tree) = 1;
}
}
/* Declare a common object of SIZE bytes using asm directive INIT_STRING.
NAME is the name of the object and ALIGN is the required alignment
in bytes. TAKES_ALIGNMENT_P is true if the directive takes a third
alignment argument. */
void
mips_declare_common_object (FILE *stream, const char *name,
const char *init_string,
unsigned HOST_WIDE_INT size,
unsigned int align, bool takes_alignment_p)
{
if (!takes_alignment_p)
{
size += (align / BITS_PER_UNIT) - 1;
size -= size % (align / BITS_PER_UNIT);
mips_declare_object (stream, name, init_string,
"," HOST_WIDE_INT_PRINT_UNSIGNED "\n", size);
}
else
mips_declare_object (stream, name, init_string,
"," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n",
size, align / BITS_PER_UNIT);
}
/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as the
elfos.h version, but we also need to handle -muninit-const-in-rodata. */
void
mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name,
unsigned HOST_WIDE_INT size,
unsigned int align)
{
/* If the target wants uninitialized const declarations in
.rdata then don't put them in .comm. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TARGET_EMBEDDED_DATA
&& TARGET_UNINIT_CONST_IN_RODATA
&& TREE_CODE (decl) == VAR_DECL
&& TREE_READONLY (decl)
&& (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
{
if (TREE_PUBLIC (decl) && DECL_NAME (decl))
targetm.asm_out.globalize_label (stream, name);
switch_to_section (readonly_data_section);
ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT));
mips_declare_object (stream, name, "",
":\n\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED "\n",
size);
}
else
mips_declare_common_object (stream, name, "\n\t.comm\t",
size, align, true);
}
#ifdef ASM_OUTPUT_SIZE_DIRECTIVE
extern int size_directive_output;
/* Implement ASM_DECLARE_OBJECT_NAME. This is like most of the standard ELF
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
definitions except that it uses mips_declare_object to emit the label. */
void
mips_declare_object_name (FILE *stream, const char *name,
tree decl ATTRIBUTE_UNUSED)
{
#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object");
#endif
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
size_directive_output = 0;
if (!flag_inhibit_size_directive && DECL_SIZE (decl))
{
HOST_WIDE_INT size;
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
size_directive_output = 1;
size = int_size_in_bytes (TREE_TYPE (decl));
ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
}
mips_declare_object (stream, name, "", ":\n");
}
/* Implement ASM_FINISH_DECLARE_OBJECT. This is generic ELF stuff. */
void
mips_finish_declare_object (FILE *stream, tree decl, int top_level, int at_end)
{
const char *name;
name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
if (!flag_inhibit_size_directive
&& DECL_SIZE (decl) != 0
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& !at_end
&& top_level
&& DECL_INITIAL (decl) == error_mark_node
&& !size_directive_output)
{
HOST_WIDE_INT size;
size_directive_output = 1;
size = int_size_in_bytes (TREE_TYPE (decl));
ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
}
}
#endif
/* Return the FOO in the name of the ".mdebug.FOO" section associated
with the current ABI. */
static const char *
mips_mdebug_abi_name (void)
{
switch (mips_abi)
{
case ABI_32:
return "abi32";
case ABI_O64:
return "abiO64";
case ABI_N32:
return "abiN32";
case ABI_64:
return "abiN64";
case ABI_EABI:
return TARGET_64BIT ? "eabi64" : "eabi32";
default:
gcc_unreachable ();
}
}
/* Implement TARGET_ASM_FILE_START. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
static void
mips_file_start (void)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
{
default_file_start ();
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Generate a special section to describe the ABI switches used to
produce the resultant binary. This is unnecessary on IRIX and
causes unwanted warnings from the native linker. */
if (!TARGET_IRIX)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Record the ABI itself. Modern versions of binutils encode
this information in the ELF header flags, but GDB needs the
information in order to correctly debug binaries produced by
older binutils. See the function mips_gdbarch_init in
gdb/mips-tdep.c. */
fprintf (asm_out_file, "\t.section .mdebug.%s\n\t.previous\n",
mips_mdebug_abi_name ());
/* There is no ELF header flag to distinguish long32 forms of the
EABI from long64 forms. Emit a special section to help tools
such as GDB. Do the same for o64, which is sometimes used with
-mlong64. */
if (mips_abi == ABI_EABI || mips_abi == ABI_O64)
fprintf (asm_out_file, "\t.section .gcc_compiled_long%d\n"
"\t.previous\n", TARGET_LONG64 ? 64 : 32);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
#ifdef HAVE_AS_GNU_ATTRIBUTE
fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n",
(TARGET_HARD_FLOAT_ABI
? (TARGET_DOUBLE_FLOAT
? ((!TARGET_64BIT && TARGET_FLOAT64) ? 4 : 1) : 2) : 3));
#endif
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If TARGET_ABICALLS, tell GAS to generate -KPIC code. */
if (TARGET_ABICALLS)
fprintf (asm_out_file, "\t.abicalls\n");
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
if (flag_verbose_asm)
fprintf (asm_out_file, "\n%s -G value = %d, Arch = %s, ISA = %d\n",
ASM_COMMENT_START,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_small_data_threshold, mips_arch_info->name, mips_isa);
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Make the last instruction frame-related and note that it performs
the operation described by FRAME_PATTERN. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
static void
mips_set_frame_expr (rtx frame_pattern)
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
{
rtx insn;
insn = get_last_insn ();
RTX_FRAME_RELATED_P (insn) = 1;
REG_NOTES (insn) = alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR,
frame_pattern,
REG_NOTES (insn));
}
/* Return a frame-related rtx that stores REG at MEM.
REG must be a single register. */
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
static rtx
mips_frame_set (rtx mem, rtx reg)
{
rtx set;
mips-protos.h (mips_global_pic_constant_p): Delete. * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. (mips_delegitimize_address): Delete. (mips_gotoff_global, mips_load_got_page): Declare. (mips_load_got_global, mips_rewrite_small_data): Declare. * config/mips/mips.h (FIND_BASE_TERM): Remove definition. (DANGEROUS_FOR_LA25_P): Use global_got_operand. (PREDICATE_CODES): Add global_got_operand, local_got_operand and small_data_pattern. Remove CONST from const_arith_operand's entry. * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. (mips_constant_type): Delete. (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. (NUM_SYMBOL_TYPES): New macro. (mips_address_type): Remove ADDRESS_INVALID. (machine_function): Add has_gp_insn_p. (mips_constant_info): Delete. (mips_address_info): Add the address type as an extra field. Replace the c field with symbol_type. (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. (mips_reloc_offset_ok_p, mips_classify_constant): Delete. (mips_split_const, mips_symbolic_constant_p): New functions. (mips_symbolic_address_p): Take the symbol type and mode as arguments. (mips_classify_address): Return true if the address is valid, storing its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] to test whether a LO_SUM address is allowed. (mips_symbol_insns): Return 0 for general mips16 symbols. Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. Handle the new SYMBOL_GOTOFF_*s. (mips_address_insns): Update call to mips_classify_address. (mips_const_insns): Be more fussy about HIGH constants. Remove use of mips_classify_constant. Be more accurate about CONSTs. (mips_global_pic_constant_p): Delete. (const_arith_operand): Only accept CONST_INTs. (call_insn_operand): Remove call to mips_classify_constant. Let mips_symbolic_constant_p check for invalid offsets. (move_operand): Check for general_operands first. Only accept symbolic constants if they satisfy mips_symbolic_constant_p and cannot be split. (symbolic_constant): Use mips_symbolic_constant_p. (global_got_operand, local_got_operand): New predicates. (stack_operand): Update call to mips_classify_address. (mips_legitimate_address_p): Likewise. (mips_reloc, mips_lui_reloc): Delete. (mips_force_temporary): Only use the given temporary if no_new_pseudos. Use emit_move_insn. (mips_split_symbol, mips_unspec_address): New functions. (mips_unspec_offset_high): New function. (mips_load_got): Replace reloc argument with a symbol_type. Use mips_unspec_address to create the address and put it in a LO_SUM with the base register. (mips_load_got16, mips_load_got32): Delete. (mips_emit_high, mips_legitimize_symbol): Delete. (mips_gotoff_global): New function. (mips_load_got_page, mips_load_got_global): New functions. (mips_legitimize_symbol): Inline handling of LO_SUM splits. (mips_legitimize_const_move): Likewise. Remove HIGH handling. Inline code to handle constants plus invalid offsets. Use mips_split_symbol to legitimize constant pool addresses. (mips_delegitimize_address): Delete. (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. (mips_subword): Pass memrefs through mips_rewrite_small_data. (mips_output_move): Remove use of mips_classify_constant. (mips_expand_call): Use mips_unspec_offset_high to calculate the high part of the GOT address for calls to global functions. (override_options): Initialize mips_split_p[], mips_lo_relocs[] and mips_hi_relocs[]. (print_operand): Use print_operand_reloc to handle '%h' and '%R'. Remove use of mips_classify_constant. (mips_reloc_string): Delete. (print_operand_reloc): New function. (print_operand_address): Update call to mips_classify_address. (mips_rewrite_small_data_p, small_data_pattern_1): New functions. (small_data_pattern): New predicate. (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. (mips_function_has_gp_insn): New function. (mips_global_pointer): Use it. (mips_gp_insn): Delete. (mips_expand_prologue): When compiling for n32/n64 abicalls, use a single loadgp pattern to initialize $gp. Pass it the offset of _gp from the start of the current function. (mips16_gp_pseudo_reg): Revert last patch. * config/mips/mips.md (RELOC_*): Delete. (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. (got): New insn attribute. (type): Set to "load" if got == load. (length): Set to 4 if got == load, 8 if got == xgot_high. (lui[sd]i): Delete. (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. (*got_disp[sd]i, *got_page[sd]i): Likewise. (*low[sd]i): Change constraints to "d". Add a new define_split to rewrite small data constants into LO_SUMs. (loadgp): New insns. From-SVN: r73259
2003-11-04 23:13:32 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If we're saving the return address register and the DWARF return
address column differs from the hard register number, adjust the
note reg to refer to the former. */
if (REGNO (reg) == GP_REG_FIRST + 31
&& DWARF_FRAME_RETURN_COLUMN != GP_REG_FIRST + 31)
reg = gen_rtx_REG (GET_MODE (reg), DWARF_FRAME_RETURN_COLUMN);
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
set = gen_rtx_SET (VOIDmode, mem, reg);
RTX_FRAME_RELATED_P (set) = 1;
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
return set;
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
}
/* If a MIPS16e SAVE or RESTORE instruction saves or restores register
mips16e_s2_s8_regs[X], it must also save the registers in indexes
X + 1 onwards. Likewise mips16e_a0_a3_regs. */
static const unsigned char mips16e_s2_s8_regs[] = {
30, 23, 22, 21, 20, 19, 18
};
static const unsigned char mips16e_a0_a3_regs[] = {
4, 5, 6, 7
};
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
/* A list of the registers that can be saved by the MIPS16e SAVE instruction,
ordered from the uppermost in memory to the lowest in memory. */
static const unsigned char mips16e_save_restore_regs[] = {
31, 30, 23, 22, 21, 20, 19, 18, 17, 16, 7, 6, 5, 4
};
mips.h (GLOBAL_POINTER_REGNUM): New macro. * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for n32/64 PIC. (MUST_SAVE_REGISTERS): Delete. * config/mips/mips.c (mips_frame_info): Remove extra_size field. (machine_function): Add global_pointer field. (mips_classify_constant): Check for (const $gp) using pointer equality with pic_offset_table_rtx. (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_restore_gp): Use current_function_outgoing_args_size. (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of GP_REG_FIRST + 28. Handle relocation strings that have more than one '('. (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_global_pointer): New function. (mips_save_reg_p): New function, mostly split out from... (compute_frame_size): ...here. Remove handling of extra_size. Reclaim args_size if no variables depend on it. Don't treat gp as a special case: handle it in the main GPR loop. (mips_initial_elimination_offset): Fix comment. (save_restore_insns): Save every register in the GPR mask, removing distinction between mask and real_mask. (mips_output_function_prologue): Update .frame psuedo-op after the removal of extra_size. Move the SVR4 PIC stack allocation and cprestore instructions to mips_expand_prologue. (mips_gp_insn): New function. (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to the chosen global pointer. Handle SVR4 PIC stack allocation in the same way as other ABIs. Adjust varargs code accordingly. Emit a cprestore insn after allocating the stack. Use mips_gp_insn to emit the loadgp sequence. Follow it with a loadgp_blockage if not using explicit relocs. (mips_output_function_epilogue): Reinstate the default gp register. (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. (mips16_optimize_gp): Likewise. * config/mips/mips.md (UNSPEC_LOADGP): Remove. (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. (loadgp): Remove. (loadgp_blockage, cprestore): New instructions. (builtin_setjmp_setup): Implement using emit_move_insn. Use pic_offset_table_rtx. (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. (builtin_longjmp): Use gen_raw_REG to force use of $28. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r67656
2003-06-09 09:19:14 +02:00
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Return the index of the lowest X in the range [0, SIZE) for which
bit REGS[X] is set in MASK. Return SIZE if there is no such X. */
static unsigned int
mips16e_find_first_register (unsigned int mask, const unsigned char *regs,
unsigned int size)
{
unsigned int i;
for (i = 0; i < size; i++)
if (BITSET_P (mask, regs[i]))
break;
return i;
}
/* *MASK_PTR is a mask of general-purpose registers and *NUM_REGS_PTR
is the number of set bits. If *MASK_PTR contains REGS[X] for some X
in [0, SIZE), adjust *MASK_PTR and *NUM_REGS_PTR so that the same
is true for all indexes (X, SIZE). */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
static void
mips16e_mask_registers (unsigned int *mask_ptr, const unsigned char *regs,
unsigned int size, unsigned int *num_regs_ptr)
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
{
unsigned int i;
i = mips16e_find_first_register (*mask_ptr, regs, size);
for (i++; i < size; i++)
if (!BITSET_P (*mask_ptr, regs[i]))
{
*num_regs_ptr += 1;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
*mask_ptr |= 1 << regs[i];
}
}
mips.h (GLOBAL_POINTER_REGNUM): New macro. * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for n32/64 PIC. (MUST_SAVE_REGISTERS): Delete. * config/mips/mips.c (mips_frame_info): Remove extra_size field. (machine_function): Add global_pointer field. (mips_classify_constant): Check for (const $gp) using pointer equality with pic_offset_table_rtx. (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_restore_gp): Use current_function_outgoing_args_size. (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of GP_REG_FIRST + 28. Handle relocation strings that have more than one '('. (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_global_pointer): New function. (mips_save_reg_p): New function, mostly split out from... (compute_frame_size): ...here. Remove handling of extra_size. Reclaim args_size if no variables depend on it. Don't treat gp as a special case: handle it in the main GPR loop. (mips_initial_elimination_offset): Fix comment. (save_restore_insns): Save every register in the GPR mask, removing distinction between mask and real_mask. (mips_output_function_prologue): Update .frame psuedo-op after the removal of extra_size. Move the SVR4 PIC stack allocation and cprestore instructions to mips_expand_prologue. (mips_gp_insn): New function. (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to the chosen global pointer. Handle SVR4 PIC stack allocation in the same way as other ABIs. Adjust varargs code accordingly. Emit a cprestore insn after allocating the stack. Use mips_gp_insn to emit the loadgp sequence. Follow it with a loadgp_blockage if not using explicit relocs. (mips_output_function_epilogue): Reinstate the default gp register. (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. (mips16_optimize_gp): Likewise. * config/mips/mips.md (UNSPEC_LOADGP): Remove. (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. (loadgp): Remove. (loadgp_blockage, cprestore): New instructions. (builtin_setjmp_setup): Implement using emit_move_insn. Use pic_offset_table_rtx. (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. (builtin_longjmp): Use gen_raw_REG to force use of $28. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r67656
2003-06-09 09:19:14 +02:00
/* Return a simplified form of X using the register values in REG_VALUES.
REG_VALUES[R] is the last value assigned to hard register R, or null
if R has not been modified.
1992-02-06 21:09:50 +01:00
This function is rather limited, but is good enough for our purposes. */
1992-02-06 21:09:50 +01:00
static rtx
mips16e_collect_propagate_value (rtx x, rtx *reg_values)
1992-02-06 21:09:50 +01:00
{
x = avoid_constant_pool_reference (x);
1992-02-06 21:09:50 +01:00
if (UNARY_P (x))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
rtx x0 = mips16e_collect_propagate_value (XEXP (x, 0), reg_values);
return simplify_gen_unary (GET_CODE (x), GET_MODE (x),
x0, GET_MODE (XEXP (x, 0)));
}
if (ARITHMETIC_P (x))
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
rtx x0 = mips16e_collect_propagate_value (XEXP (x, 0), reg_values);
rtx x1 = mips16e_collect_propagate_value (XEXP (x, 1), reg_values);
return simplify_gen_binary (GET_CODE (x), GET_MODE (x), x0, x1);
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
if (REG_P (x)
&& reg_values[REGNO (x)]
&& !rtx_unstable_p (reg_values[REGNO (x)]))
return reg_values[REGNO (x)];
1992-02-06 21:09:50 +01:00
return x;
}
/* Return true if (set DEST SRC) stores an argument register into its
caller-allocated save slot, storing the number of that argument
register in *REGNO_PTR if so. REG_VALUES is as for
mips16e_collect_propagate_value. */
1992-02-06 21:09:50 +01:00
static bool
mips16e_collect_argument_save_p (rtx dest, rtx src, rtx *reg_values,
unsigned int *regno_ptr)
{
unsigned int argno, regno;
HOST_WIDE_INT offset, required_offset;
rtx addr, base;
/* Check that this is a word-mode store. */
if (!MEM_P (dest) || !REG_P (src) || GET_MODE (dest) != word_mode)
return false;
/* Check that the register being saved is an unmodified argument
register. */
regno = REGNO (src);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!IN_RANGE (regno, GP_ARG_FIRST, GP_ARG_LAST) || reg_values[regno])
return false;
argno = regno - GP_ARG_FIRST;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Check whether the address is an appropriate stack-pointer or
frame-pointer access. */
addr = mips16e_collect_propagate_value (XEXP (dest, 0), reg_values);
mips_split_plus (addr, &base, &offset);
required_offset = cfun->machine->frame.total_size + argno * UNITS_PER_WORD;
if (base == hard_frame_pointer_rtx)
required_offset -= cfun->machine->frame.hard_frame_pointer_offset;
else if (base != stack_pointer_rtx)
return false;
if (offset != required_offset)
return false;
1992-02-06 21:09:50 +01:00
*regno_ptr = regno;
return true;
1992-02-06 21:09:50 +01:00
}
/* A subroutine of mips_expand_prologue, called only when generating
MIPS16e SAVE instructions. Search the start of the function for any
instructions that save argument registers into their caller-allocated
save slots. Delete such instructions and return a value N such that
saving [GP_ARG_FIRST, GP_ARG_FIRST + N) would make all the deleted
instructions redundant. */
static unsigned int
mips16e_collect_argument_saves (void)
{
rtx reg_values[FIRST_PSEUDO_REGISTER];
rtx insn, next, set, dest, src;
unsigned int nargs, regno;
push_topmost_sequence ();
nargs = 0;
memset (reg_values, 0, sizeof (reg_values));
for (insn = get_insns (); insn; insn = next)
{
next = NEXT_INSN (insn);
if (NOTE_P (insn))
continue;
if (!INSN_P (insn))
break;
set = PATTERN (insn);
if (GET_CODE (set) != SET)
break;
dest = SET_DEST (set);
src = SET_SRC (set);
if (mips16e_collect_argument_save_p (dest, src, reg_values, &regno))
{
if (!BITSET_P (cfun->machine->frame.mask, regno))
{
delete_insn (insn);
nargs = MAX (nargs, (regno - GP_ARG_FIRST) + 1);
}
}
else if (REG_P (dest) && GET_MODE (dest) == word_mode)
reg_values[REGNO (dest)]
= mips16e_collect_propagate_value (src, reg_values);
else
break;
}
pop_topmost_sequence ();
return nargs;
}
/* Return a move between register REGNO and memory location SP + OFFSET.
Make the move a load if RESTORE_P, otherwise make it a frame-related
store. */
static rtx
mips16e_save_restore_reg (bool restore_p, HOST_WIDE_INT offset,
unsigned int regno)
{
rtx reg, mem;
mem = gen_frame_mem (SImode, plus_constant (stack_pointer_rtx, offset));
reg = gen_rtx_REG (SImode, regno);
return (restore_p
? gen_rtx_SET (VOIDmode, reg, mem)
: mips_frame_set (mem, reg));
}
/* Return RTL for a MIPS16e SAVE or RESTORE instruction; RESTORE_P says which.
The instruction must:
- Allocate or deallocate SIZE bytes in total; SIZE is known
to be nonzero.
1992-02-06 21:09:50 +01:00
- Save or restore as many registers in *MASK_PTR as possible.
The instruction saves the first registers at the top of the
allocated area, with the other registers below it.
1992-02-06 21:09:50 +01:00
- Save NARGS argument registers above the allocated area.
(NARGS is always zero if RESTORE_P.)
The SAVE and RESTORE instructions cannot save and restore all general
registers, so there may be some registers left over for the caller to
handle. Destructively modify *MASK_PTR so that it contains the registers
that still need to be saved or restored. The caller can save these
registers in the memory immediately below *OFFSET_PTR, which is a
byte offset from the bottom of the allocated stack area. */
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
static rtx
mips16e_build_save_restore (bool restore_p, unsigned int *mask_ptr,
HOST_WIDE_INT *offset_ptr, unsigned int nargs,
HOST_WIDE_INT size)
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
{
rtx pattern, set;
HOST_WIDE_INT offset, top_offset;
unsigned int i, regno;
int n;
gcc_assert (cfun->machine->frame.num_fp == 0);
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
/* Calculate the number of elements in the PARALLEL. We need one element
for the stack adjustment, one for each argument register save, and one
for each additional register move. */
n = 1 + nargs;
for (i = 0; i < ARRAY_SIZE (mips16e_save_restore_regs); i++)
if (BITSET_P (*mask_ptr, mips16e_save_restore_regs[i]))
n++;
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
/* Create the final PARALLEL. */
pattern = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (n));
n = 0;
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
/* Add the stack pointer adjustment. */
set = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
plus_constant (stack_pointer_rtx,
restore_p ? size : -size));
RTX_FRAME_RELATED_P (set) = 1;
XVECEXP (pattern, 0, n++) = set;
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
/* Stack offsets in the PARALLEL are relative to the old stack pointer. */
top_offset = restore_p ? size : 0;
/* Save the arguments. */
for (i = 0; i < nargs; i++)
{
offset = top_offset + i * UNITS_PER_WORD;
set = mips16e_save_restore_reg (restore_p, offset, GP_ARG_FIRST + i);
XVECEXP (pattern, 0, n++) = set;
}
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
/* Then fill in the other register moves. */
offset = top_offset;
for (i = 0; i < ARRAY_SIZE (mips16e_save_restore_regs); i++)
{
regno = mips16e_save_restore_regs[i];
if (BITSET_P (*mask_ptr, regno))
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
{
offset -= UNITS_PER_WORD;
set = mips16e_save_restore_reg (restore_p, offset, regno);
XVECEXP (pattern, 0, n++) = set;
*mask_ptr &= ~(1 << regno);
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
}
}
/* Tell the caller what offset it should use for the remaining registers. */
*offset_ptr = size + (offset - top_offset);
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
gcc_assert (n == XVECLEN (pattern, 0));
return pattern;
}
/* PATTERN is a PARALLEL whose first element adds ADJUST to the stack
pointer. Return true if PATTERN matches the kind of instruction
generated by mips16e_build_save_restore. If INFO is nonnull,
initialize it when returning true. */
1992-02-06 21:09:50 +01:00
bool
mips16e_save_restore_pattern_p (rtx pattern, HOST_WIDE_INT adjust,
struct mips16e_save_restore_info *info)
1992-02-06 21:09:50 +01:00
{
unsigned int i, nargs, mask, extra;
HOST_WIDE_INT top_offset, save_offset, offset;
rtx set, reg, mem, base;
int n;
1992-02-06 21:09:50 +01:00
if (!GENERATE_MIPS16E_SAVE_RESTORE)
return false;
/* Stack offsets in the PARALLEL are relative to the old stack pointer. */
top_offset = adjust > 0 ? adjust : 0;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
/* Interpret all other members of the PARALLEL. */
save_offset = top_offset - UNITS_PER_WORD;
mask = 0;
nargs = 0;
i = 0;
for (n = 1; n < XVECLEN (pattern, 0); n++)
{
/* Check that we have a SET. */
set = XVECEXP (pattern, 0, n);
if (GET_CODE (set) != SET)
return false;
config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. * config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. (mips-sgi-irix6*): Likewise. * config/mips/iris6gas.h: New file. * gcc/config.gcc (mips-sgi-irix6*): Use it. * config/mips/mips.h (TARGET_IRIX): Provide default. (TARGET_IRIX5): Likewise. (TARGET_SGI_O32_AS): Likewise. * config/mips/iris5.h (TARGET_IRIX): Redefine as 1. (TARGET_IRIX5): Likewise. * config/mips/iris6.h (TARGET_IRIX6): Remove. (TARGET_IRIX5): Redefine as 0. * config/mips/mips.c (mips_output_external): Test for IRIX 6 O32 linker workaround with TARGET_IRIX and mips_abi instead of ASM_OUTPUT_UNDEF_FUNCTION. (mips_file_end): Inline old ASM_OUTPUT_UNDEF_FUNCTION definition, testing TARGET_IRIX and mips_abi explicitly. * config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove. * config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove undef. * config/mips/mips.c (irix_output_external_libcall): Renamed from mips_output_external_libcall. Use new TARGET_IRIX in guard. * config/mips/mips-protos.h (irix_output_external_libcall): Match this. * config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Likewise. * config/mips/iris5gas.h (HAVE_GAS_SHF_MERGE): Update comment. Define as 0. * config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define depending on mips_abi. * config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Define as 1. * config/mips/mips.c (mips_output_function_prologue): Test FUNCTION_NAME_ALREADY_DECLARED at runtime. (mips_output_function_epilogue): Likewise. (build_mips16_function_stub): Likewise. (build_mips16_call_stub): Likewise. * config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide default. * config/mips/iris6.h (DWARF2_UNWIND_INFO): Don't define for native IRIX 6 O32 assembler. (SUBTARGET_CC1_SPEC): Enforce mips2 ISA with O32 ABI. (TARGET_OS_CPP_BUILTINS): Define _ABIO32, use it to define _MIPS_SIM for O32 ABI. (DWARF2_FRAME_INFO): Don't define for native IRIX 6 O32 assembler. (ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version. (ASM_DECLARE_FUNCTION_SIZE): Move undef before redefinition. Integrate O32 version. (SUBTARGET_ASM_SPEC): Handle -mabi=32. (SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with O32 ABI. (BSS_SECTION_ASM_OP_32): Define. (BSS_SECTION_ASM_OP_64): Likewise. (BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs using them. (TARGET_ASM_NAMED_SECTION): Reflect renaming. Move up to allow override for O32 ABI without GNU as. (EH_FRAME_SECTION_NAME): Define explicitly. (MUST_USE_SJLJ_EXCEPTIONS): Define. [_MIPS_SIM == _ABIO32 && !GAS] (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Dummy definitions. (TARGET_ASM_NAMED_SECTION): Undef statically. (EH_FRAME_SECTION_NAME): Likewise. (ASM_OUTPUT_FILENAME): Integrate mips.h version. (LINK_SPEC): Only use default options -call_shared -no_unresolved without -r. Don't pass -init, -fini with -mabi=32. (COLLECT_PARSE_FLAG): Define. * config/mips/mips.c (iris6_asm_named_section_1): Changed guard to TARGET_IRIX. Renamed to use irix_ prefix. (iris6_asm_named_section): Likewise. (iris_section_align_entry_eq): Likewise. (iris_section_align_entry_hash): Likewise. (iris6_file_start): Likewise. (iris6_section_align_1): Likewise. (iris6_file_end): Likewise. (iris6_section_type_flags): Likewise. (iris_section_align_htab): Likewise. (iris_orig_asm_out_file): Likewise. [TARGET_IRIX] (TARGET_ASM_FILE_START): Reflect rename. (TARGET_ASM_FILE_END): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * config/mips/mips.c [TARGET_IRIX5 && !TARGET_IRIX6] (TARGET_ASM_UNALIGNED_HI_OP): Use runtime initialization in override_options instead. (TARGET_ASM_UNALIGNED_SI_OP): Likewise. (TARGET_ASM_UNALIGNED_DI_OP): Likewise. * config/mips/mips.c (override_options) [USE_COLLECT2]: Restore flag_gnu_linker to defaults without USE_COLLECT2 for non-IRIX O32 assemblers. Likewise for constructor/destructor handling. (override_options): Handle IRIX O32 assembler quirks. [TARGET_IRIX] (irix_asm_named_section): Handle O32 ABI with and without gas. (mips_file_start): Use new TARGET_IRIX. (mips_declare_object_name): No special processing for IRIX O32 assembler. (mips_finish_declare_object): Likewise. (irix_asm_output_align): Renamed from iris6_asm_output_align. Don't record alignment for O32 ABI. (irix_file_start): Renamed from iris6_file_start. Return early for O32 ABI. (irix_file_end): Renamed from iris6_file_end. Don't emit .section directives for O32 ABI. * config/mips/iris6.h (ASM_OUTPUT_ALIGN): Reflect renaming. * config/mips/mips-protos.h (irix_asm_output_align): Likewise. * config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32. (MULTILIB_OSDIRNAMES): Likewise. From-SVN: r72600
2003-10-17 13:44:33 +02:00
/* Check that the SET is a load (if restoring) or a store
(if saving). */
mem = adjust > 0 ? SET_SRC (set) : SET_DEST (set);
if (!MEM_P (mem))
return false;
config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. * config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. (mips-sgi-irix6*): Likewise. * config/mips/iris6gas.h: New file. * gcc/config.gcc (mips-sgi-irix6*): Use it. * config/mips/mips.h (TARGET_IRIX): Provide default. (TARGET_IRIX5): Likewise. (TARGET_SGI_O32_AS): Likewise. * config/mips/iris5.h (TARGET_IRIX): Redefine as 1. (TARGET_IRIX5): Likewise. * config/mips/iris6.h (TARGET_IRIX6): Remove. (TARGET_IRIX5): Redefine as 0. * config/mips/mips.c (mips_output_external): Test for IRIX 6 O32 linker workaround with TARGET_IRIX and mips_abi instead of ASM_OUTPUT_UNDEF_FUNCTION. (mips_file_end): Inline old ASM_OUTPUT_UNDEF_FUNCTION definition, testing TARGET_IRIX and mips_abi explicitly. * config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove. * config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove undef. * config/mips/mips.c (irix_output_external_libcall): Renamed from mips_output_external_libcall. Use new TARGET_IRIX in guard. * config/mips/mips-protos.h (irix_output_external_libcall): Match this. * config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Likewise. * config/mips/iris5gas.h (HAVE_GAS_SHF_MERGE): Update comment. Define as 0. * config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define depending on mips_abi. * config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Define as 1. * config/mips/mips.c (mips_output_function_prologue): Test FUNCTION_NAME_ALREADY_DECLARED at runtime. (mips_output_function_epilogue): Likewise. (build_mips16_function_stub): Likewise. (build_mips16_call_stub): Likewise. * config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide default. * config/mips/iris6.h (DWARF2_UNWIND_INFO): Don't define for native IRIX 6 O32 assembler. (SUBTARGET_CC1_SPEC): Enforce mips2 ISA with O32 ABI. (TARGET_OS_CPP_BUILTINS): Define _ABIO32, use it to define _MIPS_SIM for O32 ABI. (DWARF2_FRAME_INFO): Don't define for native IRIX 6 O32 assembler. (ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version. (ASM_DECLARE_FUNCTION_SIZE): Move undef before redefinition. Integrate O32 version. (SUBTARGET_ASM_SPEC): Handle -mabi=32. (SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with O32 ABI. (BSS_SECTION_ASM_OP_32): Define. (BSS_SECTION_ASM_OP_64): Likewise. (BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs using them. (TARGET_ASM_NAMED_SECTION): Reflect renaming. Move up to allow override for O32 ABI without GNU as. (EH_FRAME_SECTION_NAME): Define explicitly. (MUST_USE_SJLJ_EXCEPTIONS): Define. [_MIPS_SIM == _ABIO32 && !GAS] (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Dummy definitions. (TARGET_ASM_NAMED_SECTION): Undef statically. (EH_FRAME_SECTION_NAME): Likewise. (ASM_OUTPUT_FILENAME): Integrate mips.h version. (LINK_SPEC): Only use default options -call_shared -no_unresolved without -r. Don't pass -init, -fini with -mabi=32. (COLLECT_PARSE_FLAG): Define. * config/mips/mips.c (iris6_asm_named_section_1): Changed guard to TARGET_IRIX. Renamed to use irix_ prefix. (iris6_asm_named_section): Likewise. (iris_section_align_entry_eq): Likewise. (iris_section_align_entry_hash): Likewise. (iris6_file_start): Likewise. (iris6_section_align_1): Likewise. (iris6_file_end): Likewise. (iris6_section_type_flags): Likewise. (iris_section_align_htab): Likewise. (iris_orig_asm_out_file): Likewise. [TARGET_IRIX] (TARGET_ASM_FILE_START): Reflect rename. (TARGET_ASM_FILE_END): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * config/mips/mips.c [TARGET_IRIX5 && !TARGET_IRIX6] (TARGET_ASM_UNALIGNED_HI_OP): Use runtime initialization in override_options instead. (TARGET_ASM_UNALIGNED_SI_OP): Likewise. (TARGET_ASM_UNALIGNED_DI_OP): Likewise. * config/mips/mips.c (override_options) [USE_COLLECT2]: Restore flag_gnu_linker to defaults without USE_COLLECT2 for non-IRIX O32 assemblers. Likewise for constructor/destructor handling. (override_options): Handle IRIX O32 assembler quirks. [TARGET_IRIX] (irix_asm_named_section): Handle O32 ABI with and without gas. (mips_file_start): Use new TARGET_IRIX. (mips_declare_object_name): No special processing for IRIX O32 assembler. (mips_finish_declare_object): Likewise. (irix_asm_output_align): Renamed from iris6_asm_output_align. Don't record alignment for O32 ABI. (irix_file_start): Renamed from iris6_file_start. Return early for O32 ABI. (irix_file_end): Renamed from iris6_file_end. Don't emit .section directives for O32 ABI. * config/mips/iris6.h (ASM_OUTPUT_ALIGN): Reflect renaming. * config/mips/mips-protos.h (irix_asm_output_align): Likewise. * config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32. (MULTILIB_OSDIRNAMES): Likewise. From-SVN: r72600
2003-10-17 13:44:33 +02:00
/* Check that the address is the sum of the stack pointer and a
possibly-zero constant offset. */
mips_split_plus (XEXP (mem, 0), &base, &offset);
if (base != stack_pointer_rtx)
return false;
configure.ac (mips*-*-*): Print an error if not using GAS. * configure.ac (mips*-*-*): Print an error if not using GAS. * configure: Regenerated. * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove comments about buggy MIPSpro assemblers. * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor of more general IRIX 6 definitions. (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. (LINK_SPEC): Move most of definition to iris.h. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. * config/mips/iris6.h (TARGET_IRIX5): Remove override. (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. (TARGET_IRIX6): Define to 1. (DRIVER_SELF_SPECS): Define. (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. (SUBTARGET_LINK_SPEC): New macro. (IRIX_STARTFILE_SPEC): Fold into... (STARTFILE_SPEC): ...here. Remove !mabi=* case. (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. (LIB_SPEC, LIBGCC_SPEC): Use them. (LIB_SPEC): Remove !mabi=* case. (IRIX_ENDFILE_SPEC): Fold into... (ENDFILE_SPEC): ...here. Remove !mabi=* case. * config/mips/mips-protos.h (irix_output_external_libcall): Delete. * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. (TARGET_IRIX6): New macro. (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) (LABEL_AFTER_LOC): Delete. * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. (mips_build_builtin_va_list): Check TARGET_IRIX6. (override_options): Remove TARGET_SGI_O32_AS-related code. (irix_output_external_libcall): Make static. (mips_output_filename): Avoid use of SET_FILE_NUMBER and LABEL_AFTER_LOC. (mips_file_start): Tidy guard for ABI sections. Remove use of ABICALLS_ASM_OP; use .abicalls instead. (mips_output_aligned_decl_common, mips_declare_object_name) (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting .globl foo .text directives. (irix_asm_named_section_1, irix_asm_named_section) (irix_section_align_entry, irix_section_align_htab) (irix_orig_asm_out_file, irix_section_align_entry_eq) (irix_section_align_entry_hash, irix_asm_output_align) (irix_file_start, irix_section_align_1, copy_file_data) (irix_file_end, irix_section_type_flags): Delete. * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. Use standard section syntax. Remove protective "jr $31". (__gcc_fini): Likewise .gcc_fini. * config/mips/irix-crtn.asm: Adjust sections accordingly. * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from iris5gas.h. * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved from t-irix-gld. (EXTRA_MULTILIB_PARTS): Define. * config/mips/t-iris6: Remove bogus comment. (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. * config/mips/iris5gas.h, config/mips/iris5gld.h, config/mips/iris6gas.h, config/mips/iris6gld.h, config/mips/t-iris5-as, config/mips/t-iris5-gas config/mips/t-irix-gld: Delete. * config/mips/iris.h: New file. * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. From-SVN: r86309
2004-08-20 12:21:02 +02:00
/* Check that SET's other operand is a register. */
reg = adjust > 0 ? SET_DEST (set) : SET_SRC (set);
if (!REG_P (reg))
return false;
/* Check for argument saves. */
if (offset == top_offset + nargs * UNITS_PER_WORD
&& REGNO (reg) == GP_ARG_FIRST + nargs)
nargs++;
else if (offset == save_offset)
{
while (mips16e_save_restore_regs[i++] != REGNO (reg))
if (i == ARRAY_SIZE (mips16e_save_restore_regs))
return false;
mask |= 1 << REGNO (reg);
save_offset -= UNITS_PER_WORD;
}
else
return false;
}
/* Check that the restrictions on register ranges are met. */
extra = 0;
mips16e_mask_registers (&mask, mips16e_s2_s8_regs,
ARRAY_SIZE (mips16e_s2_s8_regs), &extra);
mips16e_mask_registers (&mask, mips16e_a0_a3_regs,
ARRAY_SIZE (mips16e_a0_a3_regs), &extra);
if (extra != 0)
return false;
/* Make sure that the topmost argument register is not saved twice.
The checks above ensure that the same is then true for the other
argument registers. */
if (nargs > 0 && BITSET_P (mask, GP_ARG_FIRST + nargs - 1))
return false;
/* Pass back information, if requested. */
if (info)
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
{
info->nargs = nargs;
info->mask = mask;
info->size = (adjust > 0 ? adjust : -adjust);
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
}
return true;
mips.h (GLOBAL_POINTER_REGNUM): New macro. * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for n32/64 PIC. (MUST_SAVE_REGISTERS): Delete. * config/mips/mips.c (mips_frame_info): Remove extra_size field. (machine_function): Add global_pointer field. (mips_classify_constant): Check for (const $gp) using pointer equality with pic_offset_table_rtx. (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_restore_gp): Use current_function_outgoing_args_size. (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of GP_REG_FIRST + 28. Handle relocation strings that have more than one '('. (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_global_pointer): New function. (mips_save_reg_p): New function, mostly split out from... (compute_frame_size): ...here. Remove handling of extra_size. Reclaim args_size if no variables depend on it. Don't treat gp as a special case: handle it in the main GPR loop. (mips_initial_elimination_offset): Fix comment. (save_restore_insns): Save every register in the GPR mask, removing distinction between mask and real_mask. (mips_output_function_prologue): Update .frame psuedo-op after the removal of extra_size. Move the SVR4 PIC stack allocation and cprestore instructions to mips_expand_prologue. (mips_gp_insn): New function. (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to the chosen global pointer. Handle SVR4 PIC stack allocation in the same way as other ABIs. Adjust varargs code accordingly. Emit a cprestore insn after allocating the stack. Use mips_gp_insn to emit the loadgp sequence. Follow it with a loadgp_blockage if not using explicit relocs. (mips_output_function_epilogue): Reinstate the default gp register. (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. (mips16_optimize_gp): Likewise. * config/mips/mips.md (UNSPEC_LOADGP): Remove. (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. (loadgp): Remove. (loadgp_blockage, cprestore): New instructions. (builtin_setjmp_setup): Implement using emit_move_insn. Use pic_offset_table_rtx. (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. (builtin_longjmp): Use gen_raw_REG to force use of $28. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r67656
2003-06-09 09:19:14 +02:00
}
/* Add a MIPS16e SAVE or RESTORE register-range argument to string S
for the register range [MIN_REG, MAX_REG]. Return a pointer to
the null terminator. */
static char *
mips16e_add_register_range (char *s, unsigned int min_reg,
unsigned int max_reg)
{
if (min_reg != max_reg)
s += sprintf (s, ",%s-%s", reg_names[min_reg], reg_names[max_reg]);
else
s += sprintf (s, ",%s", reg_names[min_reg]);
return s;
}
/* Return the assembly instruction for a MIPS16e SAVE or RESTORE instruction.
PATTERN and ADJUST are as for mips16e_save_restore_pattern_p. */
const char *
mips16e_output_save_restore (rtx pattern, HOST_WIDE_INT adjust)
{
static char buffer[300];
struct mips16e_save_restore_info info;
unsigned int i, end;
char *s;
/* Parse the pattern. */
if (!mips16e_save_restore_pattern_p (pattern, adjust, &info))
gcc_unreachable ();
/* Add the mnemonic. */
s = strcpy (buffer, adjust > 0 ? "restore\t" : "save\t");
s += strlen (s);
/* Save the arguments. */
if (info.nargs > 1)
s += sprintf (s, "%s-%s,", reg_names[GP_ARG_FIRST],
reg_names[GP_ARG_FIRST + info.nargs - 1]);
else if (info.nargs == 1)
s += sprintf (s, "%s,", reg_names[GP_ARG_FIRST]);
/* Emit the amount of stack space to allocate or deallocate. */
s += sprintf (s, "%d", (int) info.size);
/* Save or restore $16. */
if (BITSET_P (info.mask, 16))
s += sprintf (s, ",%s", reg_names[GP_REG_FIRST + 16]);
/* Save or restore $17. */
if (BITSET_P (info.mask, 17))
s += sprintf (s, ",%s", reg_names[GP_REG_FIRST + 17]);
/* Save or restore registers in the range $s2...$s8, which
mips16e_s2_s8_regs lists in decreasing order. Note that this
is a software register range; the hardware registers are not
numbered consecutively. */
end = ARRAY_SIZE (mips16e_s2_s8_regs);
i = mips16e_find_first_register (info.mask, mips16e_s2_s8_regs, end);
if (i < end)
s = mips16e_add_register_range (s, mips16e_s2_s8_regs[end - 1],
mips16e_s2_s8_regs[i]);
/* Save or restore registers in the range $a0...$a3. */
end = ARRAY_SIZE (mips16e_a0_a3_regs);
i = mips16e_find_first_register (info.mask, mips16e_a0_a3_regs, end);
if (i < end)
s = mips16e_add_register_range (s, mips16e_a0_a3_regs[i],
mips16e_a0_a3_regs[end - 1]);
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Save or restore $31. */
if (BITSET_P (info.mask, 31))
s += sprintf (s, ",%s", reg_names[GP_REG_FIRST + 31]);
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
return buffer;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
/* Return true if the current function has an insn that implicitly
refers to $gp. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
static bool
mips_function_has_gp_insn (void)
{
/* Don't bother rechecking if we found one last time. */
if (!cfun->machine->has_gp_insn_p)
{
rtx insn;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
push_topmost_sequence ();
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (USEFUL_INSN_P (insn)
&& (get_attr_got (insn) != GOT_UNSET
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
|| mips_small_data_pattern_p (PATTERN (insn))))
{
cfun->machine->has_gp_insn_p = true;
break;
}
pop_topmost_sequence ();
}
return cfun->machine->has_gp_insn_p;
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Return true if the current function returns its value in a floating-point
register in MIPS16 mode. */
static bool
mips16_cfun_returns_in_fpr_p (void)
{
tree return_type = DECL_RESULT (current_function_decl);
return (TARGET_MIPS16
&& TARGET_HARD_FLOAT_ABI
&& !aggregate_value_p (return_type, current_function_decl)
&& mips_return_mode_in_fpr_p (DECL_MODE (return_type)));
}
/* Return the register that should be used as the global pointer
within this function. Return 0 if the function doesn't need
a global pointer. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
static unsigned int
mips_global_pointer (void)
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
{
unsigned int regno;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* $gp is always available unless we're using a GOT. */
if (!TARGET_USE_GOT)
return GLOBAL_POINTER_REGNUM;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* We must always provide $gp when it is used implicitly. */
if (!TARGET_EXPLICIT_RELOCS)
return GLOBAL_POINTER_REGNUM;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* FUNCTION_PROFILER includes a jal macro, so we need to give it
a valid gp. */
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
if (crtl->profile)
return GLOBAL_POINTER_REGNUM;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* If the function has a nonlocal goto, $gp must hold the correct
global pointer for the target function. */
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->has_nonlocal_goto)
return GLOBAL_POINTER_REGNUM;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* If the gp is never referenced, there's no need to initialize it.
Note that reload can sometimes introduce constant pool references
into a function that otherwise didn't need them. For example,
suppose we have an instruction like:
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
(set (reg:DF R1) (float:DF (reg:SI R2)))
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
If R2 turns out to be constant such as 1, the instruction may have a
REG_EQUAL note saying that R1 == 1.0. Reload then has the option of
using this constant if R2 doesn't get allocated to a register.
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
In cases like these, reload will have added the constant to the pool
but no instruction will yet refer to it. */
if (!df_regs_ever_live_p (GLOBAL_POINTER_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->uses_const_pool
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
&& !mips16_cfun_returns_in_fpr_p ()
&& !mips_function_has_gp_insn ())
return 0;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* We need a global pointer, but perhaps we can use a call-clobbered
register instead of $gp. */
if (TARGET_CALL_SAVED_GP && current_function_is_leaf)
for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++)
if (!df_regs_ever_live_p (regno)
&& call_really_used_regs[regno]
&& !fixed_regs[regno]
&& regno != PIC_FUNCTION_ADDR_REGNUM)
return regno;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
return GLOBAL_POINTER_REGNUM;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if the current function must save register REGNO. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
static bool
mips_save_reg_p (unsigned int regno)
{
/* We only need to save $gp if TARGET_CALL_SAVED_GP and only then
if we have not chosen a call-clobbered substitute. */
if (regno == GLOBAL_POINTER_REGNUM)
return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Check call-saved registers. */
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->saves_all_registers || df_regs_ever_live_p (regno))
&& !call_really_used_regs[regno])
return true;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Save both registers in an FPR pair if either one is used. This is
needed for the case when MIN_FPRS_PER_FMT == 1, which allows the odd
register to be used without the even register. */
if (FP_REG_P (regno)
&& MAX_FPRS_PER_FMT == 2
&& df_regs_ever_live_p (regno + 1)
&& !call_really_used_regs[regno + 1])
return true;
/* We need to save the old frame pointer before setting up a new one. */
if (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)
return true;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Check for registers that must be saved for FUNCTION_PROFILER. */
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
if (crtl->profile && MIPS_SAVE_REG_FOR_PROFILING_P (regno))
return true;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* We need to save the incoming return address if it is ever clobbered
within the function, if __builtin_eh_return is being used to set a
different return address, or if a stub is being used to return a
value in FPRs. */
if (regno == GP_REG_FIRST + 31
&& (df_regs_ever_live_p (regno)
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
|| mips16_cfun_returns_in_fpr_p ()))
return true;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
return false;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
/* Populate the current function's mips_frame_info structure.
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
MIPS stack frames look like:
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
+-------------------------------+
| |
| incoming stack arguments |
| |
+-------------------------------+
| |
| caller-allocated save area |
A | for register arguments |
| |
+-------------------------------+ <-- incoming stack pointer
| |
| callee-allocated save area |
B | for arguments that are |
| split between registers and |
| the stack |
| |
+-------------------------------+ <-- arg_pointer_rtx
| |
C | callee-allocated save area |
| for register varargs |
| |
+-------------------------------+ <-- frame_pointer_rtx + fp_sp_offset
| | + UNITS_PER_HWFPVALUE
| FPR save area |
| |
+-------------------------------+ <-- frame_pointer_rtx + gp_sp_offset
| | + UNITS_PER_WORD
| GPR save area |
| |
+-------------------------------+
| | \
| local variables | | var_size
| | /
+-------------------------------+
| | \
| $gp save area | | cprestore_size
| | /
P +-------------------------------+ <-- hard_frame_pointer_rtx for
| | MIPS16 code
| outgoing stack arguments |
| |
+-------------------------------+
| |
| caller-allocated save area |
| for register arguments |
| |
+-------------------------------+ <-- stack_pointer_rtx
frame_pointer_rtx
hard_frame_pointer_rtx for
non-MIPS16 code.
At least two of A, B and C will be empty.
Dynamic stack allocations such as alloca insert data at point P.
They decrease stack_pointer_rtx but leave frame_pointer_rtx and
hard_frame_pointer_rtx unchanged. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
static void
mips_compute_frame_info (void)
{
struct mips_frame_info *frame;
HOST_WIDE_INT offset, size;
unsigned int regno, i;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
frame = &cfun->machine->frame;
memset (frame, 0, sizeof (*frame));
size = get_frame_size ();
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
cfun->machine->global_pointer = mips_global_pointer ();
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* The first STARTING_FRAME_OFFSET bytes contain the outgoing argument
area and the $gp save slot. This area isn't needed in leaf functions,
but if the target-independent frame size is nonzero, we're committed
to allocating it anyway. */
if (size == 0 && current_function_is_leaf)
{
/* The MIPS 3.0 linker does not like functions that dynamically
allocate the stack and have 0 for STACK_DYNAMIC_OFFSET, since it
looks like we are trying to create a second frame pointer to the
function, so allocate some stack space to make it happy. */
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->calls_alloca)
frame->args_size = REG_PARM_STACK_SPACE (cfun->decl);
else
frame->args_size = 0;
frame->cprestore_size = 0;
}
else
{
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
frame->args_size = crtl->outgoing_args_size;
frame->cprestore_size = STARTING_FRAME_OFFSET - frame->args_size;
}
offset = frame->args_size + frame->cprestore_size;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Move above the local variables. */
frame->var_size = MIPS_STACK_ALIGN (size);
offset += frame->var_size;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Find out which GPRs we need to save. */
for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++)
if (mips_save_reg_p (regno))
{
frame->num_gp++;
frame->mask |= 1 << (regno - GP_REG_FIRST);
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* If this function calls eh_return, we must also save and restore the
EH data registers. */
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)
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM; i++)
{
frame->num_gp++;
frame->mask |= 1 << (EH_RETURN_DATA_REGNO (i) - GP_REG_FIRST);
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* The MIPS16e SAVE and RESTORE instructions have two ranges of registers:
$a3-$a0 and $s2-$s8. If we save one register in the range, we must
save all later registers too. */
if (GENERATE_MIPS16E_SAVE_RESTORE)
{
mips16e_mask_registers (&frame->mask, mips16e_s2_s8_regs,
ARRAY_SIZE (mips16e_s2_s8_regs), &frame->num_gp);
mips16e_mask_registers (&frame->mask, mips16e_a0_a3_regs,
ARRAY_SIZE (mips16e_a0_a3_regs), &frame->num_gp);
}
/* Move above the GPR save area. */
if (frame->num_gp > 0)
{
offset += MIPS_STACK_ALIGN (frame->num_gp * UNITS_PER_WORD);
frame->gp_sp_offset = offset - UNITS_PER_WORD;
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Find out which FPRs we need to save. This loop must iterate over
the same space as its companion in mips_for_each_saved_reg. */
if (TARGET_HARD_FLOAT)
for (regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno += MAX_FPRS_PER_FMT)
if (mips_save_reg_p (regno))
{
frame->num_fp += MAX_FPRS_PER_FMT;
frame->fmask |= ~(~0 << MAX_FPRS_PER_FMT) << (regno - FP_REG_FIRST);
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Move above the FPR save area. */
if (frame->num_fp > 0)
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
{
offset += MIPS_STACK_ALIGN (frame->num_fp * UNITS_PER_FPREG);
frame->fp_sp_offset = offset - UNITS_PER_HWFPVALUE;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
/* Move above the callee-allocated varargs save area. */
offset += MIPS_STACK_ALIGN (cfun->machine->varargs_size);
frame->arg_pointer_offset = offset;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Move above the callee-allocated area for pretend stack arguments. */
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
offset += crtl->args.pretend_args_size;
frame->total_size = offset;
/* Work out the offsets of the save areas from the top of the frame. */
if (frame->gp_sp_offset > 0)
frame->gp_save_offset = frame->gp_sp_offset - offset;
if (frame->fp_sp_offset > 0)
frame->fp_save_offset = frame->fp_sp_offset - offset;
/* MIPS16 code offsets the frame pointer by the size of the outgoing
arguments. This tends to increase the chances of using unextended
instructions for local variables and incoming arguments. */
if (TARGET_MIPS16)
frame->hard_frame_pointer_offset = frame->args_size;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
/* Return the style of GP load sequence that is being used for the
current function. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
enum mips_loadgp_style
mips_current_loadgp_style (void)
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
{
if (!TARGET_USE_GOT || cfun->machine->global_pointer == 0)
return LOADGP_NONE;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
if (TARGET_RTP_PIC)
return LOADGP_RTP;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
if (TARGET_ABSOLUTE_ABICALLS)
return LOADGP_ABSOLUTE;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
return TARGET_NEWABI ? LOADGP_NEWABI : LOADGP_OLDABI;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement FRAME_POINTER_REQUIRED. */
bool
mips_frame_pointer_required (void)
{
/* If the function contains dynamic stack allocations, we need to
use the frame pointer to access the static parts of the frame. */
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->calls_alloca)
return true;
/* In MIPS16 mode, we need a frame pointer for a large frame; otherwise,
reload may be unable to compute the address of a local variable,
since there is no way to add a large constant to the stack pointer
without using a second temporary register. */
if (TARGET_MIPS16)
{
mips_compute_frame_info ();
if (!SMALL_OPERAND (cfun->machine->frame.total_size))
return true;
}
return false;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement INITIAL_ELIMINATION_OFFSET. FROM is either the frame pointer
or argument pointer. TO is either the stack pointer or hard frame
pointer. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
HOST_WIDE_INT
mips_initial_elimination_offset (int from, int to)
{
HOST_WIDE_INT offset;
mips_compute_frame_info ();
/* Set OFFSET to the offset from the soft frame pointer, which is also
the offset from the end-of-prologue stack pointer. */
switch (from)
{
case FRAME_POINTER_REGNUM:
offset = 0;
break;
case ARG_POINTER_REGNUM:
offset = cfun->machine->frame.arg_pointer_offset;
break;
default:
gcc_unreachable ();
}
if (to == HARD_FRAME_POINTER_REGNUM)
offset -= cfun->machine->frame.hard_frame_pointer_offset;
return offset;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
/* Implement TARGET_EXTRA_LIVE_ON_ENTRY. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
static void
mips_extra_live_on_entry (bitmap regs)
{
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
if (TARGET_USE_GOT)
{
/* PIC_FUNCTION_ADDR_REGNUM is live if we need it to set up
the global pointer. */
if (!TARGET_ABSOLUTE_ABICALLS)
bitmap_set_bit (regs, PIC_FUNCTION_ADDR_REGNUM);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* The prologue may set MIPS16_PIC_TEMP_REGNUM to the value of
the global pointer. */
if (TARGET_MIPS16)
bitmap_set_bit (regs, MIPS16_PIC_TEMP_REGNUM);
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
/* See the comment above load_call<mode> for details. */
bitmap_set_bit (regs, GOT_VERSION_REGNUM);
}
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement RETURN_ADDR_RTX. We do not support moving back to a
previous frame. */
rtx
mips_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
{
if (count != 0)
return const0_rtx;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
return get_hard_reg_initial_val (Pmode, GP_REG_FIRST + 31);
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Emit code to change the current function's return address to
ADDRESS. SCRATCH is available as a scratch register, if needed.
ADDRESS and SCRATCH are both word-mode GPRs. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
void
mips_set_return_address (rtx address, rtx scratch)
{
rtx slot_address;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
gcc_assert (BITSET_P (cfun->machine->frame.mask, 31));
slot_address = mips_add_offset (scratch, stack_pointer_rtx,
cfun->machine->frame.gp_sp_offset);
mips_emit_move (gen_frame_mem (GET_MODE (address), slot_address), address);
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Return a MEM rtx for the cprestore slot, using TEMP as a temporary base
register if need be. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
static rtx
mips_cprestore_slot (rtx temp)
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
const struct mips_frame_info *frame;
rtx base;
HOST_WIDE_INT offset;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
frame = &cfun->machine->frame;
if (frame_pointer_needed)
{
base = hard_frame_pointer_rtx;
offset = frame->args_size - frame->hard_frame_pointer_offset;
}
else
{
base = stack_pointer_rtx;
offset = frame->args_size;
}
return gen_frame_mem (Pmode, mips_add_offset (temp, base, offset));
}
/* Restore $gp from its save slot, using TEMP as a temporary base register
if need be. This function is for o32 and o64 abicalls only. */
void
mips_restore_gp (rtx temp)
{
gcc_assert (TARGET_ABICALLS && TARGET_OLDABI);
mips.h (GLOBAL_POINTER_REGNUM): New macro. * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for n32/64 PIC. (MUST_SAVE_REGISTERS): Delete. * config/mips/mips.c (mips_frame_info): Remove extra_size field. (machine_function): Add global_pointer field. (mips_classify_constant): Check for (const $gp) using pointer equality with pic_offset_table_rtx. (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_restore_gp): Use current_function_outgoing_args_size. (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of GP_REG_FIRST + 28. Handle relocation strings that have more than one '('. (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_global_pointer): New function. (mips_save_reg_p): New function, mostly split out from... (compute_frame_size): ...here. Remove handling of extra_size. Reclaim args_size if no variables depend on it. Don't treat gp as a special case: handle it in the main GPR loop. (mips_initial_elimination_offset): Fix comment. (save_restore_insns): Save every register in the GPR mask, removing distinction between mask and real_mask. (mips_output_function_prologue): Update .frame psuedo-op after the removal of extra_size. Move the SVR4 PIC stack allocation and cprestore instructions to mips_expand_prologue. (mips_gp_insn): New function. (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to the chosen global pointer. Handle SVR4 PIC stack allocation in the same way as other ABIs. Adjust varargs code accordingly. Emit a cprestore insn after allocating the stack. Use mips_gp_insn to emit the loadgp sequence. Follow it with a loadgp_blockage if not using explicit relocs. (mips_output_function_epilogue): Reinstate the default gp register. (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. (mips16_optimize_gp): Likewise. * config/mips/mips.md (UNSPEC_LOADGP): Remove. (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. (loadgp): Remove. (loadgp_blockage, cprestore): New instructions. (builtin_setjmp_setup): Implement using emit_move_insn. Use pic_offset_table_rtx. (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. (builtin_longjmp): Use gen_raw_REG to force use of $28. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r67656
2003-06-09 09:19:14 +02:00
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_MIPS16)
{
mips_emit_move (temp, mips_cprestore_slot (temp));
mips_emit_move (pic_offset_table_rtx, temp);
}
else
mips_emit_move (pic_offset_table_rtx, mips_cprestore_slot (temp));
if (!TARGET_EXPLICIT_RELOCS)
emit_insn (gen_blockage ());
}
/* A function to save or store a register. The first argument is the
register and the second is the stack slot. */
typedef void (*mips_save_restore_fn) (rtx, rtx);
1992-02-06 21:09:50 +01:00
/* Use FN to save or restore register REGNO. MODE is the register's
mode and OFFSET is the offset of its save slot from the current
stack pointer. */
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
static void
mips_save_restore_reg (enum machine_mode mode, int regno,
HOST_WIDE_INT offset, mips_save_restore_fn fn)
{
rtx mem;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
mem = gen_frame_mem (mode, plus_constant (stack_pointer_rtx, offset));
fn (gen_rtx_REG (mode, regno), mem);
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Call FN for each register that is saved by the current function.
SP_OFFSET is the offset of the current stack pointer from the start
of the frame. */
1996-12-09 23:31:23 +01:00
static void
mips_for_each_saved_reg (HOST_WIDE_INT sp_offset, mips_save_restore_fn fn)
{
enum machine_mode fpr_mode;
HOST_WIDE_INT offset;
int regno;
/* Save registers starting from high to low. The debuggers prefer at least
the return register be stored at func+4, and also it allows us not to
need a nop in the epilogue if at least one register is reloaded in
addition to return address. */
offset = cfun->machine->frame.gp_sp_offset - sp_offset;
for (regno = GP_REG_LAST; regno >= GP_REG_FIRST; regno--)
if (BITSET_P (cfun->machine->frame.mask, regno - GP_REG_FIRST))
{
mips_save_restore_reg (word_mode, regno, offset, fn);
offset -= UNITS_PER_WORD;
}
/* This loop must iterate over the same space as its companion in
mips_compute_frame_info. */
offset = cfun->machine->frame.fp_sp_offset - sp_offset;
fpr_mode = (TARGET_SINGLE_FLOAT ? SFmode : DFmode);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
for (regno = FP_REG_LAST - MAX_FPRS_PER_FMT + 1;
regno >= FP_REG_FIRST;
regno -= MAX_FPRS_PER_FMT)
if (BITSET_P (cfun->machine->frame.fmask, regno - FP_REG_FIRST))
{
mips_save_restore_reg (fpr_mode, regno, offset, fn);
offset -= GET_MODE_SIZE (fpr_mode);
}
}
/* If we're generating n32 or n64 abicalls, and the current function
does not use $28 as its global pointer, emit a cplocal directive.
Use pic_offset_table_rtx as the argument to the directive. */
static void
mips_output_cplocal (void)
{
if (!TARGET_EXPLICIT_RELOCS
&& cfun->machine->global_pointer > 0
&& cfun->machine->global_pointer != GLOBAL_POINTER_REGNUM)
output_asm_insn (".cplocal %+", 0);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_OUTPUT_FUNCTION_PROLOGUE. */
static void
mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
const char *fnname;
#ifdef SDB_DEBUGGING_INFO
if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
SDB_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl));
#endif
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* In MIPS16 mode, we may need to generate a non-MIPS16 stub to handle
floating-point arguments. */
if (TARGET_MIPS16
&& TARGET_HARD_FLOAT_ABI
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.fp_code != 0)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_build_function_stub ();
/* Get the function name the same way that toplev.c does before calling
assemble_start_function. This is needed so that the name used here
exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */
fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
mips_start_function_definition (fnname, TARGET_MIPS16);
mips.h (GLOBAL_POINTER_REGNUM): New macro. * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for n32/64 PIC. (MUST_SAVE_REGISTERS): Delete. * config/mips/mips.c (mips_frame_info): Remove extra_size field. (machine_function): Add global_pointer field. (mips_classify_constant): Check for (const $gp) using pointer equality with pic_offset_table_rtx. (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_restore_gp): Use current_function_outgoing_args_size. (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of GP_REG_FIRST + 28. Handle relocation strings that have more than one '('. (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. (mips_global_pointer): New function. (mips_save_reg_p): New function, mostly split out from... (compute_frame_size): ...here. Remove handling of extra_size. Reclaim args_size if no variables depend on it. Don't treat gp as a special case: handle it in the main GPR loop. (mips_initial_elimination_offset): Fix comment. (save_restore_insns): Save every register in the GPR mask, removing distinction between mask and real_mask. (mips_output_function_prologue): Update .frame psuedo-op after the removal of extra_size. Move the SVR4 PIC stack allocation and cprestore instructions to mips_expand_prologue. (mips_gp_insn): New function. (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to the chosen global pointer. Handle SVR4 PIC stack allocation in the same way as other ABIs. Adjust varargs code accordingly. Emit a cprestore insn after allocating the stack. Use mips_gp_insn to emit the loadgp sequence. Follow it with a loadgp_blockage if not using explicit relocs. (mips_output_function_epilogue): Reinstate the default gp register. (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. (mips16_optimize_gp): Likewise. * config/mips/mips.md (UNSPEC_LOADGP): Remove. (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. (loadgp): Remove. (loadgp_blockage, cprestore): New instructions. (builtin_setjmp_setup): Implement using emit_move_insn. Use pic_offset_table_rtx. (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. (builtin_longjmp): Use gen_raw_REG to force use of $28. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r67656
2003-06-09 09:19:14 +02:00
/* Stop mips_file_end from treating this function as external. */
if (TARGET_IRIX && mips_abi == ABI_32)
TREE_ASM_WRITTEN (DECL_NAME (cfun->decl)) = 1;
predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/predicates.md (const_call_insn_operand): Allow direct calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. Use TARGET_OLDABI instead of !TARGET_NEWABI. (loadgp): Use mips_current_loadgp_style. (loadgp_noshared): New pattern. (sibcall_internal): Use MIPS_CALL. (sibcall_value_internal): Likewise. (sibcall_value_multiple_internal): Likewise. (call_internal): Likewise. (call_value_internal): Likewise. (call_value_multiple_internal): Likewise. (call_split): Use MIPS_CALL and add an 'S' constraint. (call_value_split): Likewise. (call_value_multiple_split): Likewise. * config/mips/mips.opt (-mabicalls): Tweak docstring. (-mshared): New option. * config/mips/mips-protos.h (mips_loadgp_style): New enum. (mips_current_loadgp_style): Declare. * config/mips/mips.c (mips_classify_symbol): Avoid using SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if TARGET_ABSOLUTE_ABICALLS. (override_options): Adjust comments. Improve the warning that is issued when -mabicalls and -G are used together. (mips_file_start): Remove comment. (mips_current_loadgp_style): New function. (mips_gnu_local_gp): New variable. (mips_emit_loadgp): Use mips_current_loadgp_style. Handle LOADGP_ABSOLUTE. (mips_output_function_prologue): Use mips_current_laodgp_style. (mips_expand_prologue): Call mips_emit_loadgp before emitting the cprestore instruction. (mips_extra_live_on_entry): Fix reversed test. Don't make $25 live for TARGET_ABSOLUTE_ABICALLS. * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. (ASM_SPEC): Pass down -mshared and -mno-shared. (MIPS_CALL): New macro. * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ definition. * doc/invoke.texi (-mabicalls): Update documentation. (-mshared): Document. From-SVN: r112261
2006-03-21 22:49:13 +01:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Output MIPS-specific frame information. */
if (!flag_inhibit_size_directive)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
const struct mips_frame_info *frame;
frame = &cfun->machine->frame;
/* .frame FRAMEREG, FRAMESIZE, RETREG. */
fprintf (file,
"\t.frame\t%s," HOST_WIDE_INT_PRINT_DEC ",%s\t\t"
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
"# vars= " HOST_WIDE_INT_PRINT_DEC
", regs= %d/%d"
", args= " HOST_WIDE_INT_PRINT_DEC
", gp= " HOST_WIDE_INT_PRINT_DEC "\n",
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
reg_names[frame_pointer_needed
? HARD_FRAME_POINTER_REGNUM
: STACK_POINTER_REGNUM],
(frame_pointer_needed
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
? frame->total_size - frame->hard_frame_pointer_offset
: frame->total_size),
reg_names[GP_REG_FIRST + 31],
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
frame->var_size,
frame->num_gp, frame->num_fp,
frame->args_size,
frame->cprestore_size);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* .mask MASK, OFFSET. */
fprintf (file, "\t.mask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n",
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
frame->mask, frame->gp_save_offset);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* .fmask MASK, OFFSET. */
fprintf (file, "\t.fmask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n",
frame->fmask, frame->fp_save_offset);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Handle the initialization of $gp for SVR4 PIC, if applicable.
Also emit the ".set noreorder; .set nomacro" sequence for functions
that need it. */
if (mips_current_loadgp_style () == LOADGP_OLDABI)
{
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_MIPS16)
{
/* This is a fixed-form sequence. The position of the
first two instructions is important because of the
way _gp_disp is defined. */
output_asm_insn ("li\t$2,%%hi(_gp_disp)", 0);
output_asm_insn ("addiu\t$3,$pc,%%lo(_gp_disp)", 0);
output_asm_insn ("sll\t$2,16", 0);
output_asm_insn ("addu\t$2,$3", 0);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* .cpload must be in a .set noreorder but not a .set nomacro block. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
else if (!cfun->machine->all_noreorder_p)
output_asm_insn ("%(.cpload\t%^%)", 0);
else
output_asm_insn ("%(.cpload\t%^\n\t%<", 0);
}
else if (cfun->machine->all_noreorder_p)
output_asm_insn ("%(%<", 0);
/* Tell the assembler which register we're using as the global
pointer. This is needed for thunks, since they can use either
explicit relocs or assembler macros. */
mips_output_cplocal ();
1992-02-06 21:09:50 +01:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_OUTPUT_FUNCTION_EPILOGUE. */
1993-02-09 18:06:09 +01:00
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
mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
HOST_WIDE_INT size ATTRIBUTE_UNUSED)
1992-02-06 21:09:50 +01:00
{
const char *fnname;
/* Reinstate the normal $gp. */
SET_REGNO (pic_offset_table_rtx, GLOBAL_POINTER_REGNUM);
mips_output_cplocal ();
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
if (cfun->machine->all_noreorder_p)
{
/* Avoid using %>%) since it adds excess whitespace. */
output_asm_insn (".set\tmacro", 0);
output_asm_insn (".set\treorder", 0);
set_noreorder = set_nomacro = 0;
}
/* Get the function name the same way that toplev.c does before calling
assemble_start_function. This is needed so that the name used here
exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */
fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
mips_end_function_definition (fnname);
1992-02-06 21:09:50 +01:00
}
/* Save register REG to MEM. Make the instruction frame-related. */
static void
mips_save_reg (rtx reg, rtx mem)
{
if (GET_MODE (reg) == DFmode && !TARGET_FLOAT64)
{
rtx x1, x2;
if (mips_split_64bit_move_p (mem, reg))
mips_split_doubleword_move (mem, reg);
else
mips_emit_move (mem, reg);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
x1 = mips_frame_set (mips_subword (mem, false),
mips_subword (reg, false));
x2 = mips_frame_set (mips_subword (mem, true),
mips_subword (reg, true));
mips_set_frame_expr (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, x1, x2)));
}
else
{
if (TARGET_MIPS16
&& REGNO (reg) != GP_REG_FIRST + 31
&& !M16_REG_P (REGNO (reg)))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Save a non-MIPS16 register by moving it through a temporary.
We don't need to do this for $31 since there's a special
instruction for it. */
mips_emit_move (MIPS_PROLOGUE_TEMP (GET_MODE (reg)), reg);
mips_emit_move (mem, MIPS_PROLOGUE_TEMP (GET_MODE (reg)));
}
else
mips_emit_move (mem, reg);
mips_set_frame_expr (mips_frame_set (mem, reg));
}
}
/* The __gnu_local_gp symbol. */
static GTY(()) rtx mips_gnu_local_gp;
/* If we're generating n32 or n64 abicalls, emit instructions
to set up the global pointer. */
static void
mips_emit_loadgp (void)
{
rtx addr, offset, incoming_address, base, index, pic_reg;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
pic_reg = TARGET_MIPS16 ? MIPS16_PIC_TEMP : pic_offset_table_rtx;
switch (mips_current_loadgp_style ())
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
{
case LOADGP_ABSOLUTE:
if (mips_gnu_local_gp == NULL)
{
mips_gnu_local_gp = gen_rtx_SYMBOL_REF (Pmode, "__gnu_local_gp");
SYMBOL_REF_FLAGS (mips_gnu_local_gp) |= SYMBOL_FLAG_LOCAL;
}
emit_insn (Pmode == SImode
? gen_loadgp_absolute_si (pic_reg, mips_gnu_local_gp)
: gen_loadgp_absolute_di (pic_reg, mips_gnu_local_gp));
break;
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
case LOADGP_OLDABI:
/* Added by mips_output_function_prologue. */
break;
case LOADGP_NEWABI:
addr = XEXP (DECL_RTL (current_function_decl), 0);
offset = mips_unspec_address (addr, SYMBOL_GOTOFF_LOADGP);
incoming_address = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
emit_insn (Pmode == SImode
? gen_loadgp_newabi_si (pic_reg, offset, incoming_address)
: gen_loadgp_newabi_di (pic_reg, offset, incoming_address));
break;
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
case LOADGP_RTP:
base = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (VXWORKS_GOTT_BASE));
index = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (VXWORKS_GOTT_INDEX));
emit_insn (Pmode == SImode
? gen_loadgp_rtp_si (pic_reg, base, index)
: gen_loadgp_rtp_di (pic_reg, base, index));
break;
default:
return;
}
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (TARGET_MIPS16)
emit_insn (gen_copygp_mips16 (pic_offset_table_rtx, pic_reg));
/* Emit a blockage if there are implicit uses of the GP register.
This includes profiled functions, because FUNCTION_PROFILE uses
a jal macro. */
if (!TARGET_EXPLICIT_RELOCS || crtl->profile)
emit_insn (gen_loadgp_blockage ());
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Expand the "prologue" pattern. */
void
mips_expand_prologue (void)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
const struct mips_frame_info *frame;
HOST_WIDE_INT size;
unsigned int nargs;
rtx insn;
if (cfun->machine->global_pointer > 0)
SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
frame = &cfun->machine->frame;
size = frame->total_size;
/* Save the registers. Allocate up to MIPS_MAX_FIRST_STACK_STEP
bytes beforehand; this is enough to cover the register save area
without going out of range. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if ((frame->mask | frame->fmask) != 0)
{
HOST_WIDE_INT step1;
step1 = MIN (size, MIPS_MAX_FIRST_STACK_STEP);
if (GENERATE_MIPS16E_SAVE_RESTORE)
{
HOST_WIDE_INT offset;
unsigned int mask, regno;
/* Try to merge argument stores into the save instruction. */
nargs = mips16e_collect_argument_saves ();
/* Build the save instruction. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mask = frame->mask;
insn = mips16e_build_save_restore (false, &mask, &offset,
nargs, step1);
RTX_FRAME_RELATED_P (emit_insn (insn)) = 1;
size -= step1;
/* Check if we need to save other registers. */
for (regno = GP_REG_FIRST; regno < GP_REG_LAST; regno++)
if (BITSET_P (mask, regno - GP_REG_FIRST))
{
offset -= UNITS_PER_WORD;
mips_save_restore_reg (word_mode, regno,
offset, mips_save_reg);
}
}
else
{
insn = gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
GEN_INT (-step1));
RTX_FRAME_RELATED_P (emit_insn (insn)) = 1;
size -= step1;
mips_for_each_saved_reg (size, mips_save_reg);
}
}
/* Allocate the rest of the frame. */
if (size > 0)
{
if (SMALL_OPERAND (-size))
RTX_FRAME_RELATED_P (emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
GEN_INT (-size)))) = 1;
else
{
mips_emit_move (MIPS_PROLOGUE_TEMP (Pmode), GEN_INT (size));
if (TARGET_MIPS16)
{
/* There are no instructions to add or subtract registers
from the stack pointer, so use the frame pointer as a
temporary. We should always be using a frame pointer
in this case anyway. */
gcc_assert (frame_pointer_needed);
mips_emit_move (hard_frame_pointer_rtx, stack_pointer_rtx);
emit_insn (gen_sub3_insn (hard_frame_pointer_rtx,
hard_frame_pointer_rtx,
MIPS_PROLOGUE_TEMP (Pmode)));
mips_emit_move (stack_pointer_rtx, hard_frame_pointer_rtx);
}
else
emit_insn (gen_sub3_insn (stack_pointer_rtx,
stack_pointer_rtx,
MIPS_PROLOGUE_TEMP (Pmode)));
/* Describe the combined effect of the previous instructions. */
mips_set_frame_expr
(gen_rtx_SET (VOIDmode, stack_pointer_rtx,
plus_constant (stack_pointer_rtx, -size)));
}
}
/* Set up the frame pointer, if we're using one. */
if (frame_pointer_needed)
{
HOST_WIDE_INT offset;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
offset = frame->hard_frame_pointer_offset;
if (offset == 0)
{
insn = mips_emit_move (hard_frame_pointer_rtx, stack_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
}
else if (SMALL_OPERAND (offset))
{
insn = gen_add3_insn (hard_frame_pointer_rtx,
stack_pointer_rtx, GEN_INT (offset));
RTX_FRAME_RELATED_P (emit_insn (insn)) = 1;
}
else
{
mips_emit_move (MIPS_PROLOGUE_TEMP (Pmode), GEN_INT (offset));
mips_emit_move (hard_frame_pointer_rtx, stack_pointer_rtx);
emit_insn (gen_add3_insn (hard_frame_pointer_rtx,
hard_frame_pointer_rtx,
MIPS_PROLOGUE_TEMP (Pmode)));
mips_set_frame_expr
(gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx,
plus_constant (stack_pointer_rtx, offset)));
}
}
mips_emit_loadgp ();
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Initialize the $gp save slot. */
if (frame->cprestore_size > 0)
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
{
if (TARGET_MIPS16)
mips_emit_move (mips_cprestore_slot (MIPS_PROLOGUE_TEMP (Pmode)),
MIPS16_PIC_TEMP);
else
emit_insn (gen_cprestore (GEN_INT (frame->args_size)));
}
/* If we are profiling, make sure no instructions are scheduled before
the call to mcount. */
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
if (crtl->profile)
emit_insn (gen_blockage ());
}
/* Emit instructions to restore register REG from slot MEM. */
static void
mips_restore_reg (rtx reg, rtx mem)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* There's no MIPS16 instruction to load $31 directly. Load into
$7 instead and adjust the return insn appropriately. */
if (TARGET_MIPS16 && REGNO (reg) == GP_REG_FIRST + 31)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
reg = gen_rtx_REG (GET_MODE (reg), GP_REG_FIRST + 7);
if (TARGET_MIPS16 && !M16_REG_P (REGNO (reg)))
{
/* Can't restore directly; move through a temporary. */
mips_emit_move (MIPS_EPILOGUE_TEMP (GET_MODE (reg)), mem);
mips_emit_move (reg, MIPS_EPILOGUE_TEMP (GET_MODE (reg)));
}
else
mips_emit_move (reg, mem);
}
/* Emit any instructions needed before a return. */
void
mips_expand_before_return (void)
{
/* When using a call-clobbered gp, we start out with unified call
insns that include instructions to restore the gp. We then split
these unified calls after reload. These split calls explicitly
clobber gp, so there is no need to define
PIC_OFFSET_TABLE_REG_CALL_CLOBBERED.
For consistency, we should also insert an explicit clobber of $28
before return insns, so that the post-reload optimizers know that
the register is not live on exit. */
if (TARGET_CALL_CLOBBERED_GP)
emit_clobber (pic_offset_table_rtx);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Expand an "epilogue" or "sibcall_epilogue" pattern; SIBCALL_P
says which. */
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_expand_epilogue (bool sibcall_p)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
const struct mips_frame_info *frame;
HOST_WIDE_INT step1, step2;
rtx base, target;
if (!sibcall_p && mips_can_use_return_insn ())
{
emit_jump_insn (gen_return ());
return;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* In MIPS16 mode, if the return value should go into a floating-point
register, we need to call a helper routine to copy it over. */
if (mips16_cfun_returns_in_fpr_p ())
mips16_copy_fpr_return_value ();
/* Split the frame into two. STEP1 is the amount of stack we should
deallocate before restoring the registers. STEP2 is the amount we
should deallocate afterwards.
Start off by assuming that no registers need to be restored. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
frame = &cfun->machine->frame;
step1 = frame->total_size;
step2 = 0;
/* Work out which register holds the frame address. */
if (!frame_pointer_needed)
base = stack_pointer_rtx;
else
{
base = hard_frame_pointer_rtx;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
step1 -= frame->hard_frame_pointer_offset;
}
/* If we need to restore registers, deallocate as much stack as
possible in the second step without going out of range. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if ((frame->mask | frame->fmask) != 0)
{
step2 = MIN (step1, MIPS_MAX_FIRST_STACK_STEP);
step1 -= step2;
}
/* Set TARGET to BASE + STEP1. */
target = base;
if (step1 > 0)
{
rtx adjust;
/* Get an rtx for STEP1 that we can add to BASE. */
adjust = GEN_INT (step1);
if (!SMALL_OPERAND (step1))
{
mips_emit_move (MIPS_EPILOGUE_TEMP (Pmode), adjust);
adjust = MIPS_EPILOGUE_TEMP (Pmode);
}
/* Normal mode code can copy the result straight into $sp. */
if (!TARGET_MIPS16)
target = stack_pointer_rtx;
emit_insn (gen_add3_insn (target, base, adjust));
}
/* Copy TARGET into the stack pointer. */
if (target != stack_pointer_rtx)
mips_emit_move (stack_pointer_rtx, target);
mips.h (TARGET_SPLIT_CALLS): Check TARGET_CALL_CLOBBERED_GP. gcc/ * config/mips/mips.h (TARGET_SPLIT_CALLS): Check TARGET_CALL_CLOBBERED_GP. (TARGET_SIBCALLS): Check TARGET_USE_GOT instead of TARGET_ABICALLS. (TARGET_USE_GOT, TARGET_CALL_CLOBBERED_GP): New macros. (TARGET_CALL_SAVED_GP, TARGET_USE_PIC_FN_ADDR_REG): Likewise. (STARTING_FRAME_OFFSET): Check TARGET_CALL_CLOBBERED_GP instead of TARGET_ABICALLS && !TARGET_NEWABI. (MIPS_CALL): Check TARGET_USE_GOT instead of TARGET_ABICALLS. * config/mips/mips.c (mips_load_call_address): Check TARGET_CALL_SAVED_GP instead of TARGET_NEWABI. (mips_global_pointer): Check TARGET_USE_GOT instead of TARGET_ABICALLS. Check TARGET_CALL_SAVED_GP instead of TARGET_NEWABI. (mips_save_reg_p): Check TARGET_CALL_SAVED_GP instead of TARGET_ABICALLS && TARGET_NEWABI. (mips_current_loadgp_style): Check TARGET_USE_GOT instead of TARGET_ABICALLS. (mips_expand_prologue): Check TARGET_OLDABI instead of !TARGET_NEWABI. (mips_expand_epilogue): Check TARGET_CALL_SAVED_GP instead of TARGET_ABICALLS && TARGET_NEWABI. (mips_output_mi_thunk): Check TARGET_USE_GOT instead of TARGET_ABICALLS. Check TARGET_CALL_SAVED_GP instead of TARGET_NEWABI. Use TARGET_USE_PIC_FN_ADDR_REG to decide whether indirect calls must use $25. (mips_extra_live_on_entry): Check TARGET_GOT instead of TARGET_ABICALLS. * config/mips/mips.md (jal_macro): Check flag_pic and TARGET_CALL_CLOBBERED_GP instead of TARGET_ABICALLS and TARGET_NEWABI. (builtin_setjmp_setup, builtin_longjmp): Check TARGET_USE_GOT instead of TARGET_ABICALLS. (exception_receiver): Check TARGET_CALL_CLOBBERED_GP instead of TARGET_ABICALLS && TARGET_OLDABI. (load_call<mode>): Check TARGET_USE_GOT instead of TARGET_ABICALLS. (sibcall): In the comment above the define_insn, mention TARGET_USE_PIC_FN_ADDR_REG instead of TARGET_ABICALLS. * config/mips/constraints.md (c): Check TARGET_USE_PIC_FN_ADDR_REG instead of TARGET_ABICALLS. From-SVN: r123751
2007-04-12 19:10:56 +02:00
/* If we're using addressing macros, $gp is implicitly used by all
SYMBOL_REFs. We must emit a blockage insn before restoring $gp
from the stack. */
if (TARGET_CALL_SAVED_GP && !TARGET_EXPLICIT_RELOCS)
emit_insn (gen_blockage ());
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (GENERATE_MIPS16E_SAVE_RESTORE && frame->mask != 0)
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
{
unsigned int regno, mask;
HOST_WIDE_INT offset;
rtx restore;
/* Generate the restore instruction. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mask = frame->mask;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
restore = mips16e_build_save_restore (true, &mask, &offset, 0, step2);
/* Restore any other registers manually. */
for (regno = GP_REG_FIRST; regno < GP_REG_LAST; regno++)
if (BITSET_P (mask, regno - GP_REG_FIRST))
{
offset -= UNITS_PER_WORD;
mips_save_restore_reg (word_mode, regno, offset, mips_restore_reg);
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
}
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Restore the remaining registers and deallocate the final bit
of the frame. */
emit_insn (restore);
}
else
{
/* Restore the registers. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_for_each_saved_reg (frame->total_size - step2, mips_restore_reg);
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* Deallocate the final bit of the frame. */
if (step2 > 0)
emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
GEN_INT (step2)));
}
/* Add in the __builtin_eh_return stack adjustment. We need to
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
use a temporary in MIPS16 code. */
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)
{
if (TARGET_MIPS16)
{
mips_emit_move (MIPS_EPILOGUE_TEMP (Pmode), stack_pointer_rtx);
emit_insn (gen_add3_insn (MIPS_EPILOGUE_TEMP (Pmode),
MIPS_EPILOGUE_TEMP (Pmode),
EH_RETURN_STACKADJ_RTX));
mips_emit_move (stack_pointer_rtx, MIPS_EPILOGUE_TEMP (Pmode));
}
else
emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
}
if (!sibcall_p)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned int regno;
mips-protos.h (mips16e_save_restore_info): New struct. gcc/ 2007-07-02 Sandra Loosemore <sandra@codesourcery.com> Richard Sandiford <richard@codesourcery.com> Nigel Stephens <nigel@mips.com> * config/mips/mips-protos.h (mips16e_save_restore_info): New struct. (mips16e_output_save_restore): Declare. (mips16e_save_restore_pattern_p): Likewise. * config/mips/mips.h (GENERATE_MIPS16E_SAVE_RESTORE): New macro. * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Return 0x7f8 for GENERATE_MIPS16E_SAVE_RESTORE. Return 0x400 for TARGET_MIPS16 && !GENERATE_MIPS16E_SAVE_RESTORE && !TARGET_64BIT. (BITSET_P): New global macro, extracted from... (mips_for_each_saved_reg): ...here. (mips16e_save_restore_info): New struct. (mips16e_s2_s8_regs, mips16e_a0_a3_regs): New variables. (mips16e_save_restore_regs): New variable. (mips_split_plus, mips16e_find_first_register): New functions. (mips16e_mask_registers): New function. (compute_frame_size): Expand the commentary before the function. Enforce the MIPS16e save and restore register range restrictions. Pad the general register save area at the low end. (mips16e_save_restore_reg, mips16e_build_save_restore) (mips16e_save_restore_pattern_p, mips16e_add_register_range) (mips16e_output_save_restore, mips16e_collect_propagate_value) (mips16e_collect_argument_save, mips16e_collect_argument_saves): New functions. (mips_expand_prologue, mips_expand_epilogue): Handle GENERATE_MIPS16E_SAVE_RESTORE. * config/mips/mips.md (*mips16e_save_restore): New pattern. gcc/testsuite/ * gcc.target/mips/save-restore-1.c: New test. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. From-SVN: r126207
2007-07-02 16:37:15 +02:00
/* When generating MIPS16 code, the normal mips_for_each_saved_reg
path will restore the return address into $7 rather than $31. */
if (TARGET_MIPS16
&& !GENERATE_MIPS16E_SAVE_RESTORE
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& BITSET_P (frame->mask, 31))
regno = GP_REG_FIRST + 7;
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
regno = GP_REG_FIRST + 31;
mips_expand_before_return ();
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, regno)));
}
1992-02-06 21:09:50 +01:00
}
/* Return nonzero if this function is known to have a null epilogue.
1992-02-06 21:09:50 +01:00
This allows the optimizer to omit jumps to jumps if no stack
was created. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
bool
mips_can_use_return_insn (void)
1992-02-06 21:09:50 +01:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!reload_completed)
return false;
1992-02-06 21:09:50 +01: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
if (crtl->profile)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return false;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* In MIPS16 mode, a function that returns a floating-point value
needs to arrange to copy the return value into the floating-point
registers. */
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
if (mips16_cfun_returns_in_fpr_p ())
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return false;
return cfun->machine->frame.total_size == 0;
1992-02-06 21:09:50 +01:00
}
/* Return true if register REGNO can store a value of mode MODE.
The result of this function is cached in mips_hard_regno_mode_ok. */
static bool
mips_hard_regno_mode_ok_p (unsigned int regno, enum machine_mode mode)
{
unsigned int size;
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 mode_class mclass;
if (mode == CCV2mode)
return (ISA_HAS_8CC
&& ST_REG_P (regno)
&& (regno - ST_REG_FIRST) % 2 == 0);
if (mode == CCV4mode)
return (ISA_HAS_8CC
&& ST_REG_P (regno)
&& (regno - ST_REG_FIRST) % 4 == 0);
if (mode == CCmode)
{
if (!ISA_HAS_8CC)
return regno == FPSW_REGNUM;
return (ST_REG_P (regno)
|| GP_REG_P (regno)
|| FP_REG_P (regno));
}
size = GET_MODE_SIZE (mode);
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
mclass = GET_MODE_CLASS (mode);
if (GP_REG_P (regno))
return ((regno - GP_REG_FIRST) & 1) == 0 || size <= UNITS_PER_WORD;
if (FP_REG_P (regno)
&& (((regno - FP_REG_FIRST) % MAX_FPRS_PER_FMT) == 0
|| (MIN_FPRS_PER_FMT == 1 && size <= UNITS_PER_FPREG)))
{
/* Allow TFmode for CCmode reloads. */
if (mode == TFmode && ISA_HAS_8CC)
return true;
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
/* Allow 64-bit vector modes for Loongson-2E/2F. */
if (TARGET_LOONGSON_VECTORS
&& (mode == V2SImode
|| mode == V4HImode
|| mode == V8QImode
|| mode == DImode))
return true;
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 (mclass == MODE_FLOAT
|| mclass == MODE_COMPLEX_FLOAT
|| mclass == MODE_VECTOR_FLOAT)
return size <= UNITS_PER_FPVALUE;
/* Allow integer modes that fit into a single register. We need
to put integers into FPRs when using instructions like CVT
and TRUNC. There's no point allowing sizes smaller than a word,
because the FPU has no appropriate load/store instructions. */
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 (mclass == MODE_INT)
return size >= MIN_UNITS_PER_WORD && size <= UNITS_PER_FPREG;
}
if (ACC_REG_P (regno)
&& (INTEGRAL_MODE_P (mode) || ALL_FIXED_POINT_MODE_P (mode)))
{
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
if (MD_REG_P (regno))
{
/* After a multiplication or division, clobbering HI makes
the value of LO unpredictable, and vice versa. This means
that, for all interesting cases, HI and LO are effectively
a single register.
We model this by requiring that any value that uses HI
also uses LO. */
if (size <= UNITS_PER_WORD * 2)
return regno == (size <= UNITS_PER_WORD ? LO_REGNUM : MD_REG_FIRST);
}
else
{
/* DSP accumulators do not have the same restrictions as
HI and LO, so we can treat them as normal doubleword
registers. */
if (size <= UNITS_PER_WORD)
return true;
md.texi: Synchronize with later constraints.md change. gcc/ * doc/md.texi: Synchronize with later constraints.md change. * longlong.h (umul_ppmm): Replace the MIPS asm implementation with a C implementation. * config/mips/mips.c (mips_legitimize_move): Remove MFHI and MFLO handling. (mips_subword): Assume TImode for CONST_INTs if TARGET_64BIT. (mips_split_doubleword_move): Use special MTHI and MFHI instructions when moving to and from MD_REGNUM. (mips_output_move): Don't handle moves from GPRs to HI_REGNUM. Handle moves from LO_REGNUM to GPRs using MFLO, MACC or DMACC. Handle byte and halfword moves. (mips_hard_regno_mode_ok_p): Handle MD_REGS and DSP_ACC_REGS separately. * config/mips/constraints.md (h): Turn into NO_REGS. (l, x): Update documentation. * config/mips/mips.md (UNSPEC_MFHILO): Delete. (UNSPEC_MFHI, UNSPEC_MTHI, UNSPEC_SET_HILO): New. (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): Renumber. (HILO): New mode iterator. (MOVE128): Add TI. (any_div): New code iterator. (u): Extend code attribute to div and udiv. (*add<mode>3_mips16, *movdi_64bit_mips16, *movsi_mips16): Use d_operand in the splitters. Remove redundant CONST_INT checks. (mulsi3_mult3, mul<mode>3_internal, mul<mode>3_r4000, *mul_acc_si) (*macc, *msac, *msac_using_macc, *macc2, *msac2, *mul_sub_si) (*muls): Remove "=h" clobbers. Adjust peephole2s and define_splits accordingly, using normal moves instead of unspecs to move LO into a GPR. Use d_operand and lo_operand instead of *_REG_P checks. (<u>mulsidi3): Handle expansion in C code. (<u>mulsidi3_32bit_internal): Rename to... (<u>mulsidi3_32bit): ...this. (<u>mulsidi3_32bit_r4000): Fix insn separator. (*<u>mulsidi3_64bit): Rename to... (<u>mulsidi3_64bit): ...this. Combine DImode "=h" and "=l" clobbers into a TImode "=x" clobber. In the split, use an UNSPEC_SET_HILO to set LO and HI to the multiplication result. Use a normal move for MFLO and an unspec for MFHI. (*<u>mulsidi3_64bit_parts): Replace with... (<u>mulsidi3_64bit_hilo): ...this new instruction. (<su>mulsi3_highpart): Extend to TARGET_FIX_R4000. (<su>mulsi3_highpart_internal): Turn into a define_insn_and_split and extend it to TARGET_FIX_R4000. Store the destination in a GPR instead of HI. Split the instruction into a separate multiplication and MFHI if !TARGET_FIX_R4000. (<su>muldi3_highpart): Likewise. (<su>mulsi3_highpart_mulhi_internal): Remove the first alternative and the "=h" clobber. (*<su>mulsi3_highpart_neg_mulhi_internal): Likewise. (<u>mulditi3): New expander. (<u>mulditi3_internal, <u>mulditi3_r4000): New patterns. (madsi): Remove "=h" clobber. (divmod<mode>4, udivmod<mode>4): Turn into define_insn_and_splits. Force the modulus result to be a GPR and split the instruction into a division followed by an MFHI after reload. (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): New instruction. (*lea_high64): Use d_operand in the define_peephole2. Likewise the MIPS16 HIGH define_split. (*movdi_32bit, *movdi_gp32_fp64, *movdi_32bit_mips16): Change type of acc<->gpr moves to "multi". (*movdi_64bit): Replace the single "x" alternative with alternatives for moving into and out of "a". (*movhi_internal, *movqi_internal): Likewise. Use mips_output_move. (*movsi_internal): Extend the "d<-A" alternative to "d<-a". (*movdi_64bit_mips16, *movsi_mips16): Add d<-a alternatives. Use d_operand in the splitters. Remove redundant CONST_INT checks. (*movhi_mips16, *movqi_mips16): Likewise. Use mips_output_move. (movti): New expander. (*movti, *movti_mips16): New insns. (mfhilo_<mode>, *mfhilo_<mode>, *mfhilo_<mode>_macc): Delete. (mfhi<GPR:mode>_<HILO:mode>): New pattern. (mthi<GPR:mode>_<HILO:mode>): Likewise. * config/mips/predicates.md (fpr_operand): Delete. (d_operand): New predicate. gcc/testsuite/ * gcc.dg/torture/mips-hilo-1.c: Delete. * gcc.target/mips/pr35232.c: Likewise. * gcc.target/mips/fix-vr4130-1.c: Use modulus to create an mfhi. * gcc.target/mips/fix-vr4130-3.c: Likewise. * gcc.target/mips/int-moves-1.c: New test. * gcc.target/mips/int-moves-2.c: Likewise. * gcc.target/mips/fix-r4000-1.c: Likewise. * gcc.target/mips/fix-r4000-2.c: Likewise. * gcc.target/mips/fix-r4000-3.c: Likewise. * gcc.target/mips/fix-r4000-4.c: Likewise. * gcc.target/mips/fix-r4000-5.c: Likewise. * gcc.target/mips/fix-r4000-6.c: Likewise. * gcc.target/mips/fix-r4000-7.c: Likewise. * gcc.target/mips/fix-r4000-8.c: Likewise. * gcc.target/mips/fix-r4000-9.c: Likewise. * gcc.target/mips/fix-r4000-10.c: Likewise. * gcc.target/mips/fix-r4000-11.c: Likewise. * gcc.target/mips/fix-r4000-12.c: Likewise. * gcc.target/mips/timode-1.c: Likewise. * gcc.target/mips/timode-2.c: Likewise. From-SVN: r136600
2008-06-09 22:45:56 +02:00
if (size <= UNITS_PER_WORD * 2
&& ((regno - DSP_ACC_REG_FIRST) & 1) == 0)
return true;
}
}
if (ALL_COP_REG_P (regno))
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 mclass == MODE_INT && size <= UNITS_PER_WORD;
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
if (regno == GOT_VERSION_REGNUM)
return mode == SImode;
return false;
}
/* Implement HARD_REGNO_NREGS. */
unsigned int
mips_hard_regno_nregs (int regno, enum machine_mode mode)
{
if (ST_REG_P (regno))
/* The size of FP status registers is always 4, because they only hold
CCmode values, and CCmode is always considered to be 4 bytes wide. */
return (GET_MODE_SIZE (mode) + 3) / 4;
if (FP_REG_P (regno))
return (GET_MODE_SIZE (mode) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG;
/* All other registers are word-sized. */
return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
}
/* Implement CLASS_MAX_NREGS, taking the maximum of the cases
in mips_hard_regno_nregs. */
int
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
mips_class_max_nregs (enum reg_class rclass, enum machine_mode mode)
{
int size;
HARD_REG_SET left;
size = 0x8000;
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
COPY_HARD_REG_SET (left, reg_class_contents[(int) rclass]);
if (hard_reg_set_intersect_p (left, reg_class_contents[(int) ST_REGS]))
{
size = MIN (size, 4);
AND_COMPL_HARD_REG_SET (left, reg_class_contents[(int) ST_REGS]);
}
if (hard_reg_set_intersect_p (left, reg_class_contents[(int) FP_REGS]))
{
size = MIN (size, UNITS_PER_FPREG);
AND_COMPL_HARD_REG_SET (left, reg_class_contents[(int) FP_REGS]);
}
if (!hard_reg_set_empty_p (left))
size = MIN (size, UNITS_PER_WORD);
return (GET_MODE_SIZE (mode) + size - 1) / size;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement CANNOT_CHANGE_MODE_CLASS. */
bool
mips_cannot_change_mode_class (enum machine_mode from ATTRIBUTE_UNUSED,
enum machine_mode to ATTRIBUTE_UNUSED,
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)
{
/* There are several problems with changing the modes of values
in floating-point registers:
- When a multi-word value is stored in paired floating-point
registers, the first register always holds the low word.
We therefore can't allow FPRs to change between single-word
and multi-word modes on big-endian targets.
- GCC assumes that each word of a multiword register can be accessed
individually using SUBREGs. This is not true for floating-point
registers if they are bigger than a word.
- Loading a 32-bit value into a 64-bit floating-point register
will not sign-extend the value, despite what LOAD_EXTEND_OP says.
We can't allow FPRs to change from SImode to to a wider mode on
64-bit targets.
- If the FPU has already interpreted a value in one format, we must
not ask it to treat the value as having a different format.
We therefore disallow all mode changes involving FPRs. */
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 (FP_REGS, rclass);
}
/* Return true if moves in mode MODE can use the FPU's mov.fmt instruction. */
static bool
mips_mode_ok_for_mov_fmt_p (enum machine_mode mode)
{
switch (mode)
{
case SFmode:
return TARGET_HARD_FLOAT;
case DFmode:
return TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT;
case V2SFmode:
return TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT;
default:
return false;
}
}
invoke.texi (-mpaired-single): Don't say that the option requires 64-bit code. gcc/ * doc/invoke.texi (-mpaired-single): Don't say that the option requires 64-bit code. * config/mips/mips-protos.h (mips_modes_tieable_p): Declare. * config/mips/mips.h (ISA_HAS_PAIRED_SINGLE): New macro. (ISA_HAS_NMADD_NMSUB): Add a mode argument. Return true for V2SF if ISA_MIPS32R2. (MODES_TIEABLE_P): Use mips_modes_tieable_p. * config/mips/mips.c (mips_rtx_costs): Pass a mode argument to ISA_HAS_NMADD_NMSUB. (mips_split_doubleword_move): Handle V2SF. (mips_modes_tieable_p): New function. (override_options): Report a warning rather than an error when -mpaired-single is used on ISAs that don't support it; use ISA_HAS_PAIRED_SINGLE to check that case. * config/mips/mips.md (MOVE64): New mode iterator. Replace DI and DF move splitters with a single MOVE64 splitter, thereby adding a V2SF splitter too. (SPLITF): Add TARGET_DOUBLE_FLOAT conditions to DI and DF. Add a TARGET_FLOAT64 condition to TF. Add V2SF to the iterator. (HALFMODE): Add V2SF. (*nmadd<mode>, *nmadd<mode>_fastmath, *nmsub<mode>) (*nmsub<mode>_fastmath): Add a mode argument to ISA_HAS_NMADD_NMSUB. (movv2sf_hardfloat_64bit): Tweak ordering of conditions. (movv2sf_hardfloat_32bit): New pattern. (load_low<mode>, load_high<mode>, store_word<mode>): Remove TARGET_DOUBLE_FLOAT conditions. gcc/testsuite/ * gcc.dg/vect/vect.exp: Extend -mpaired-single handling to all MIPS targets. * g++.dg/vect/vect.exp: Likewise. * lib/fortran-torture.exp: Likewise. * gcc.target/mips/mips-ps-1.c: Use mpaired_single rather than mipsisa64*-*-* as the target selector. Remove -mips64, -mhard-float and -mgp64 from the options list. * gcc.target/mips/mips-ps-2.c: Likewise. * gcc.target/mips/mips-ps-3.c: Likewise. * gcc.target/mips/mips-ps-4.c: Likewise. * gcc.target/mips/mips-ps-6.c: Likewise. * gcc.target/mips/mips-ps-5.c: Remove -mhard-float from the options list. * gcc.target/mips/sb1-1.c: Likewise. * gcc.target/mips/mips-ps-type.c: Likewise. * gcc.target/mips/mips-ps-7.c: New test. * gcc.target/mips/mips-ps-type-2.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Remove XFAIL. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_fp and mips_gp instead of mips_fp64 and mips_gp64. Treat -mgp32 -mfp64 as forcing an ABI and an architecture. (is_gp32_flag, is_gp64_flag): Fold into... (dg-mips-options): ...here. Make -mpaired-single imply -mfp64, then -mfp64 imply -mhard-float. Apply register rules after the loop. Handle -march=mipsN like -mipsN. From-SVN: r129522
2007-10-21 11:07:13 +02:00
/* Implement MODES_TIEABLE_P. */
bool
mips_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2)
{
/* FPRs allow no mode punning, so it's not worth tying modes if we'd
prefer to put one of them in FPRs. */
return (mode1 == mode2
|| (!mips_mode_ok_for_mov_fmt_p (mode1)
&& !mips_mode_ok_for_mov_fmt_p (mode2)));
}
/* Implement PREFERRED_RELOAD_CLASS. */
enum reg_class
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
mips_preferred_reload_class (rtx x, enum reg_class rclass)
{
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 (mips_dangerous_for_la25_p (x) && reg_class_subset_p (LEA_REGS, rclass))
return LEA_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 (reg_class_subset_p (FP_REGS, rclass)
&& mips_mode_ok_for_mov_fmt_p (GET_MODE (x)))
return FP_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 (reg_class_subset_p (GR_REGS, rclass))
rclass = GR_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_MIPS16 && reg_class_subset_p (M16_REGS, rclass))
rclass = M16_REGS;
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
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
return rclass;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement REGISTER_MOVE_COST. */
int
mips_register_move_cost (enum machine_mode mode,
enum reg_class to, enum reg_class from)
{
if (TARGET_MIPS16)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* ??? We cannot move general registers into HI and LO because
MIPS16 has no MTHI and MTLO instructions. Make the cost of
moves in the opposite direction just as high, which stops the
register allocators from using HI and LO for pseudos. */
if (reg_class_subset_p (from, GENERAL_REGS)
&& reg_class_subset_p (to, GENERAL_REGS))
{
if (reg_class_subset_p (from, M16_REGS)
|| reg_class_subset_p (to, M16_REGS))
return 2;
/* Two MOVEs. */
return 4;
}
}
else if (reg_class_subset_p (from, GENERAL_REGS))
{
if (reg_class_subset_p (to, GENERAL_REGS))
return 2;
if (reg_class_subset_p (to, FP_REGS))
return 4;
if (reg_class_subset_p (to, ALL_COP_AND_GR_REGS))
return 5;
if (reg_class_subset_p (to, ACC_REGS))
return 6;
}
else if (reg_class_subset_p (to, GENERAL_REGS))
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
{
if (reg_class_subset_p (from, FP_REGS))
return 4;
if (reg_class_subset_p (from, ST_REGS))
/* LUI followed by MOVF. */
return 4;
if (reg_class_subset_p (from, ALL_COP_AND_GR_REGS))
return 5;
if (reg_class_subset_p (from, ACC_REGS))
return 6;
}
else if (reg_class_subset_p (from, FP_REGS))
{
if (reg_class_subset_p (to, FP_REGS)
&& mips_mode_ok_for_mov_fmt_p (mode))
return 4;
if (reg_class_subset_p (to, ST_REGS))
/* An expensive sequence. */
return 8;
mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. config/ * mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt. (CXXFLAGS_FOR_TARGET): Likewise. gcc/ * doc/invoke.texi: Document the MIPS -mlocal-sdata, -mextern-sdata and -mgpopt options. Adjust the -G documentation to match. * config/mips/mips.opt (mextern-data, mgpopt, mlocal-data): New. * config/mips/mips.c (mips_rtx_constant_in_small_data_p): New function, split out from mips_classify_symbol. Return false for !TARGET_LOCAL_SDATA. (mips_classify_symbol): Call mips_rtx_constant_in_small_data_p. Only use GP-relative accesses for non-pool symbols if TARGET_GPOPT. (override_options): Check whether the -mgpopt setting is consistent with the other flags. (symbolic_expression_p): Delete. (mips_select_rtx_section): Use mips_rtx_constant_in_small_data_p and default_elf_select_rtx_section. (mips_in_small_data_p): Honor section attributes for MIPS16 too. Return false for local data unless TARGET_LOCAL_SDATA. Likewise external data and TARGET_EXTERN_SDATA. gcc/testsuite/ * gcc.dg/attr-alias-3.c: Use real asm for MIPS. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_gp and mips_forced_no_er. (dg-mips-options): Add -mno-abicalls when a small-data option is specified. Skip tests with small-data options if mips_forced_gp. Skip tests with -mexplicit-relocs if mips_forced_no_er. * gcc.target/mips/sdata-1.c: New test. * gcc.target/mips/sdata-2.c: Likewise. * gcc.target/mips/sdata-3.c: Likewise. * gcc.target/mips/sdata-4.c: Likewise. From-SVN: r128230
2007-09-07 09:37:38 +02:00
}
return 12;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return the register class required for a secondary register when
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
copying between one of the registers in RCLASS and value X, which
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
has mode MODE. X is the source of the move if IN_P, otherwise it
is the destination. Return NO_REGS if no secondary register is
needed. */
enum reg_class
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
mips_secondary_reload_class (enum reg_class rclass,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
enum machine_mode mode, rtx x, bool in_p)
{
int regno;
/* If X is a constant that cannot be loaded into $25, it must be loaded
into some other GPR. No other register class allows a direct move. */
if (mips_dangerous_for_la25_p (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
return reg_class_subset_p (rclass, LEA_REGS) ? NO_REGS : LEA_REGS;
regno = true_regnum (x);
if (TARGET_MIPS16)
{
/* In MIPS16 mode, every move must involve a member of M16_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 (!reg_class_subset_p (rclass, M16_REGS) && !M16_REG_P (regno))
return M16_REGS;
/* We can't really copy to HI or LO at all in MIPS16 mode. */
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 (in_p ? reg_classes_intersect_p (rclass, ACC_REGS) : ACC_REG_P (regno))
return M16_REGS;
return NO_REGS;
}
/* Copying from accumulator registers to anywhere other than a general
register requires a temporary general register. */
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 (reg_class_subset_p (rclass, ACC_REGS))
return GP_REG_P (regno) ? NO_REGS : GR_REGS;
if (ACC_REG_P (regno))
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_class_subset_p (rclass, GR_REGS) ? NO_REGS : GR_REGS;
/* We can only copy a value to a condition code register from a
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
floating-point register, and even then we require a scratch
floating-point register. We can only copy a value out of a
condition-code register into a general register. */
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 (reg_class_subset_p (rclass, ST_REGS))
{
if (in_p)
return FP_REGS;
return GP_REG_P (regno) ? NO_REGS : GR_REGS;
}
if (ST_REG_P (regno))
{
if (!in_p)
return FP_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
return reg_class_subset_p (rclass, GR_REGS) ? NO_REGS : GR_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 (reg_class_subset_p (rclass, FP_REGS))
{
if (MEM_P (x)
&& (GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8))
/* In this case we can use lwc1, swc1, ldc1 or sdc1. We'll use
pairs of lwc1s and swc1s if ldc1 and sdc1 are not supported. */
return NO_REGS;
if (GP_REG_P (regno) || x == CONST0_RTX (mode))
/* In this case we can use mtc1, mfc1, dmtc1 or dmfc1. */
return NO_REGS;
if (CONSTANT_P (x) && !targetm.cannot_force_const_mem (x))
/* We can force the constant to memory and use lwc1
and ldc1. As above, we will use pairs of lwc1s if
ldc1 is not supported. */
return NO_REGS;
if (FP_REG_P (regno) && mips_mode_ok_for_mov_fmt_p (mode))
/* In this case we can use mov.fmt. */
return NO_REGS;
/* Otherwise, we need to reload through an integer register. */
return GR_REGS;
}
if (FP_REG_P (regno))
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_class_subset_p (rclass, GR_REGS) ? NO_REGS : GR_REGS;
return NO_REGS;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_MODE_REP_EXTENDED. */
static int
mips_mode_rep_extended (enum machine_mode mode, enum machine_mode mode_rep)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* On 64-bit targets, SImode register values are sign-extended to DImode. */
if (TARGET_64BIT && mode == SImode && mode_rep == DImode)
return SIGN_EXTEND;
return UNKNOWN;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_VALID_POINTER_MODE. */
static bool
mips_valid_pointer_mode (enum machine_mode mode)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return mode == SImode || (TARGET_64BIT && mode == DImode);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_VECTOR_MODE_SUPPORTED_P. */
static bool
mips_vector_mode_supported_p (enum machine_mode mode)
{
switch (mode)
{
case V2SFmode:
return TARGET_PAIRED_SINGLE_FLOAT;
case V2HImode:
case V4QImode:
case V2HQmode:
case V2UHQmode:
case V2HAmode:
case V2UHAmode:
case V4QQmode:
case V4UQQmode:
return TARGET_DSP;
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
case V2SImode:
case V4HImode:
case V8QImode:
return TARGET_LOONGSON_VECTORS;
default:
return false;
}
}
/* Implement TARGET_SCALAR_MODE_SUPPORTED_P. */
static bool
mips_scalar_mode_supported_p (enum machine_mode mode)
{
if (ALL_FIXED_POINT_MODE_P (mode)
&& GET_MODE_PRECISION (mode) <= 2 * BITS_PER_WORD)
return true;
return default_scalar_mode_supported_p (mode);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_INIT_LIBFUNCS. */
#include "config/gofast.h"
static void
mips_init_libfuncs (void)
{
if (TARGET_FIX_VR4120)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Register the special divsi3 and modsi3 functions needed to work
around VR4120 division errata. */
set_optab_libfunc (sdiv_optab, SImode, "__vr4120_divsi3");
set_optab_libfunc (smod_optab, SImode, "__vr4120_modsi3");
}
if (TARGET_MIPS16 && TARGET_HARD_FLOAT_ABI)
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Register the MIPS16 -mhard-float stubs. */
set_optab_libfunc (add_optab, SFmode, "__mips16_addsf3");
set_optab_libfunc (sub_optab, SFmode, "__mips16_subsf3");
set_optab_libfunc (smul_optab, SFmode, "__mips16_mulsf3");
set_optab_libfunc (sdiv_optab, SFmode, "__mips16_divsf3");
set_optab_libfunc (eq_optab, SFmode, "__mips16_eqsf2");
set_optab_libfunc (ne_optab, SFmode, "__mips16_nesf2");
set_optab_libfunc (gt_optab, SFmode, "__mips16_gtsf2");
set_optab_libfunc (ge_optab, SFmode, "__mips16_gesf2");
set_optab_libfunc (lt_optab, SFmode, "__mips16_ltsf2");
set_optab_libfunc (le_optab, SFmode, "__mips16_lesf2");
set_optab_libfunc (unord_optab, SFmode, "__mips16_unordsf2");
set_conv_libfunc (sfix_optab, SImode, SFmode, "__mips16_fix_truncsfsi");
set_conv_libfunc (sfloat_optab, SFmode, SImode, "__mips16_floatsisf");
set_conv_libfunc (ufloat_optab, SFmode, SImode, "__mips16_floatunsisf");
if (TARGET_DOUBLE_FLOAT)
{
set_optab_libfunc (add_optab, DFmode, "__mips16_adddf3");
set_optab_libfunc (sub_optab, DFmode, "__mips16_subdf3");
set_optab_libfunc (smul_optab, DFmode, "__mips16_muldf3");
set_optab_libfunc (sdiv_optab, DFmode, "__mips16_divdf3");
set_optab_libfunc (eq_optab, DFmode, "__mips16_eqdf2");
set_optab_libfunc (ne_optab, DFmode, "__mips16_nedf2");
set_optab_libfunc (gt_optab, DFmode, "__mips16_gtdf2");
set_optab_libfunc (ge_optab, DFmode, "__mips16_gedf2");
set_optab_libfunc (lt_optab, DFmode, "__mips16_ltdf2");
set_optab_libfunc (le_optab, DFmode, "__mips16_ledf2");
set_optab_libfunc (unord_optab, DFmode, "__mips16_unorddf2");
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
set_conv_libfunc (sext_optab, DFmode, SFmode,
"__mips16_extendsfdf2");
set_conv_libfunc (trunc_optab, SFmode, DFmode,
"__mips16_truncdfsf2");
set_conv_libfunc (sfix_optab, SImode, DFmode,
"__mips16_fix_truncdfsi");
set_conv_libfunc (sfloat_optab, DFmode, SImode,
"__mips16_floatsidf");
set_conv_libfunc (ufloat_optab, DFmode, SImode,
"__mips16_floatunsidf");
}
}
else
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Register the gofast functions if selected using --enable-gofast. */
gofast_maybe_init_libfuncs ();
/* The MIPS16 ISA does not have an encoding for "sync", so we rely
on an external non-MIPS16 routine to implement __sync_synchronize. */
if (TARGET_MIPS16)
synchronize_libfunc = init_one_libfunc ("__sync_synchronize");
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
}
/* Return the length of INSN. LENGTH is the initial length computed by
attributes in the machine-description file. */
int
mips_adjust_insn_length (rtx insn, int length)
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
{
/* A unconditional jump has an unfilled delay slot if it is not part
of a sequence. A conditional jump normally has a delay slot, but
does not on MIPS16. */
if (CALL_P (insn) || (TARGET_MIPS16 ? simplejump_p (insn) : JUMP_P (insn)))
length += 4;
mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. gcc: * config/mips/mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. (ISA_HAS_MXHC1): True if ISA supports mfhc1 and mthc1 opcodes. (ASM_SPEC): Pass along -mfp32 and -mfp64. * config/mips/mips.c (mips_split_64bit_move): Use gen_mthc1 to set high part of FP register when in 64-bit FP register mode. Similarly use gen_mfhc1 to load high part of FP register. (override_options): Allow -mgp32 and -mfp64 combination if ISA_HAS_MXHC1 (currently for O32 only). (mips_cannot_change_mode_class): If floating-point registers are bigger than word size. disallow conversion of float register from a large integer mode to a float mode smaller than the float register size. (mips_class_max_nregs): Handle float registers case seperately. * config/mips/mips.md (define_constants): Add UNSPEC_MFHC1, UNSPEC_MTHC1. (movdi_32bit): Use !TARGET_FLOAT64 in condition pattern. (movdf_hardfloat_32bit): Similarly. (movdi_gp32_fp64): New DImode pattern for MIPS32R2 which optionally support a full 64-bit fpu. (mthc1): New pattern to generate MTHC1 instruction. (mfhc1): New pattern to generate MFHC1 instruction. * doc/invoke.texi (MIPS Options): Document the -mgp32 -mfp64 option for the MIPS32R2 and mention its use under O32 ABI. gcc/testsuite: * gcc.target/mips/mips.exp (dg-mips-options): Handle parsing of -mfp64, allowable when ISA >= 33 and float is enabled. * gcc.target/mips/mips32r2-mxhc1.c: New test for checking the use of mthc1 and mfhc1 patterns. From-SVN: r119124
2006-11-23 17:13:46 +01:00
/* See how many nops might be needed to avoid hardware hazards. */
if (!cfun->machine->ignore_hazard_length_p && INSN_CODE (insn) >= 0)
switch (get_attr_hazard (insn))
{
case HAZARD_NONE:
break;
mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. gcc: * config/mips/mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. (ISA_HAS_MXHC1): True if ISA supports mfhc1 and mthc1 opcodes. (ASM_SPEC): Pass along -mfp32 and -mfp64. * config/mips/mips.c (mips_split_64bit_move): Use gen_mthc1 to set high part of FP register when in 64-bit FP register mode. Similarly use gen_mfhc1 to load high part of FP register. (override_options): Allow -mgp32 and -mfp64 combination if ISA_HAS_MXHC1 (currently for O32 only). (mips_cannot_change_mode_class): If floating-point registers are bigger than word size. disallow conversion of float register from a large integer mode to a float mode smaller than the float register size. (mips_class_max_nregs): Handle float registers case seperately. * config/mips/mips.md (define_constants): Add UNSPEC_MFHC1, UNSPEC_MTHC1. (movdi_32bit): Use !TARGET_FLOAT64 in condition pattern. (movdf_hardfloat_32bit): Similarly. (movdi_gp32_fp64): New DImode pattern for MIPS32R2 which optionally support a full 64-bit fpu. (mthc1): New pattern to generate MTHC1 instruction. (mfhc1): New pattern to generate MFHC1 instruction. * doc/invoke.texi (MIPS Options): Document the -mgp32 -mfp64 option for the MIPS32R2 and mention its use under O32 ABI. gcc/testsuite: * gcc.target/mips/mips.exp (dg-mips-options): Handle parsing of -mfp64, allowable when ISA >= 33 and float is enabled. * gcc.target/mips/mips32r2-mxhc1.c: New test for checking the use of mthc1 and mfhc1 patterns. From-SVN: r119124
2006-11-23 17:13:46 +01:00
case HAZARD_DELAY:
length += 4;
break;
mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. gcc: * config/mips/mips.h (ISA_HAS_FP4): Add MIPS32R2 + 64bit fpu combination. (ISA_HAS_MXHC1): True if ISA supports mfhc1 and mthc1 opcodes. (ASM_SPEC): Pass along -mfp32 and -mfp64. * config/mips/mips.c (mips_split_64bit_move): Use gen_mthc1 to set high part of FP register when in 64-bit FP register mode. Similarly use gen_mfhc1 to load high part of FP register. (override_options): Allow -mgp32 and -mfp64 combination if ISA_HAS_MXHC1 (currently for O32 only). (mips_cannot_change_mode_class): If floating-point registers are bigger than word size. disallow conversion of float register from a large integer mode to a float mode smaller than the float register size. (mips_class_max_nregs): Handle float registers case seperately. * config/mips/mips.md (define_constants): Add UNSPEC_MFHC1, UNSPEC_MTHC1. (movdi_32bit): Use !TARGET_FLOAT64 in condition pattern. (movdf_hardfloat_32bit): Similarly. (movdi_gp32_fp64): New DImode pattern for MIPS32R2 which optionally support a full 64-bit fpu. (mthc1): New pattern to generate MTHC1 instruction. (mfhc1): New pattern to generate MFHC1 instruction. * doc/invoke.texi (MIPS Options): Document the -mgp32 -mfp64 option for the MIPS32R2 and mention its use under O32 ABI. gcc/testsuite: * gcc.target/mips/mips.exp (dg-mips-options): Handle parsing of -mfp64, allowable when ISA >= 33 and float is enabled. * gcc.target/mips/mips32r2-mxhc1.c: New test for checking the use of mthc1 and mfhc1 patterns. From-SVN: r119124
2006-11-23 17:13:46 +01:00
case HAZARD_HILO:
length += 8;
break;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* In order to make it easier to share MIPS16 and non-MIPS16 patterns,
the .md file length attributes are 4-based for both modes.
Adjust the MIPS16 ones here. */
if (TARGET_MIPS16)
length /= 2;
return length;
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 an asm sequence to start a noat block and load the address
of a label into $1. */
const char *
mips_output_load_label (void)
{
if (TARGET_EXPLICIT_RELOCS)
switch (mips_abi)
{
case ABI_N32:
return "%[lw\t%@,%%got_page(%0)(%+)\n\taddiu\t%@,%@,%%got_ofst(%0)";
case ABI_64:
return "%[ld\t%@,%%got_page(%0)(%+)\n\tdaddiu\t%@,%@,%%got_ofst(%0)";
default:
if (ISA_HAS_LOAD_DELAY)
return "%[lw\t%@,%%got(%0)(%+)%#\n\taddiu\t%@,%@,%%lo(%0)";
return "%[lw\t%@,%%got(%0)(%+)\n\taddiu\t%@,%@,%%lo(%0)";
}
else
{
if (Pmode == DImode)
return "%[dla\t%@,%0";
else
return "%[la\t%@,%0";
}
}
/* Return the assembly code for INSN, which has the operands given by
OPERANDS, and which branches to OPERANDS[1] if some condition is true.
BRANCH_IF_TRUE is the asm template that should be used if OPERANDS[1]
is in range of a direct branch. BRANCH_IF_FALSE is an inverted
version of BRANCH_IF_TRUE. */
const char *
mips_output_conditional_branch (rtx insn, rtx *operands,
const char *branch_if_true,
const char *branch_if_false)
{
unsigned int length;
rtx taken, not_taken;
length = get_attr_length (insn);
if (length <= 8)
{
/* Just a simple conditional branch. */
mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
return branch_if_true;
}
/* Generate a reversed branch around a direct jump. This fallback does
not use branch-likely instructions. */
mips_branch_likely = false;
not_taken = gen_label_rtx ();
taken = operands[1];
/* Generate the reversed branch to NOT_TAKEN. */
operands[1] = not_taken;
output_asm_insn (branch_if_false, operands);
/* If INSN has a delay slot, we must provide delay slots for both the
branch to NOT_TAKEN and the conditional jump. We must also ensure
that INSN's delay slot is executed in the appropriate cases. */
if (final_sequence)
{
/* This first delay slot will always be executed, so use INSN's
delay slot if is not annulled. */
if (!INSN_ANNULLED_BRANCH_P (insn))
{
final_scan_insn (XVECEXP (final_sequence, 0, 1),
asm_out_file, optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (final_sequence, 0, 1)) = 1;
}
else
output_asm_insn ("nop", 0);
fprintf (asm_out_file, "\n");
}
/* Output the unconditional branch to TAKEN. */
if (length <= 16)
output_asm_insn ("j\t%0%/", &taken);
else
{
output_asm_insn (mips_output_load_label (), &taken);
output_asm_insn ("jr\t%@%]%/", 0);
}
/* Now deal with its delay slot; see above. */
if (final_sequence)
mips-protos.h (mips_sign_extend): Declare. * config/mips/mips-protos.h (mips_sign_extend): Declare. * config/mips/mips.h (MASK_DEBUG_H, TARGET_DEBUG_H_MODE): Remove. (TARGET_SWITCHES): Remove debugh. (ISA_HAS_TRUNC_W): New macro. (CLASS_CANNOT_CHANGE_MODE): Include FP_REGS if TARGET_FLOAT64. (PREDICATE_CODES): Remove se_nonimmediate_operand. * config/mips/mips.c (movdi_operand): Allow sign-extensions of any SImode move_operand. (se_nonimmediate_operand): Remove. (mips_sign_extend): New. (mips_move_2words): Use it for sign-extended source operands. (override_options): Allow integers to be put into single FPRs. (mips_secondary_reload_class): Handle integers in float registers. * config/mips/mips.md (extendsidi2): Turn into a define_expand. (fix_truncsfsi2, fix_truncdfsi2): Likewise. (fix_truncdfsi2_insn, fix_truncdfsi2_macro): New. (fix_truncsfsi2_insn, fix_truncsfsi2_macro): New. (fix_truncdfdi2): Provide only a single alternative, in which the integer is in a float register. Depend on TARGET_FLOAT64 rather than TARGET_64BIT. (fix_truncsfdi2, floatdidf2, floatdisf2): Likewise. (floatsidf2, floatsisf2): Likewise, but no TARGET_FLOAT64 dependency. (movdi_internal2): Don't allow the source operand to be sign-extended. Add alternatives for float registers. (*movdi_internal2_extend): New. Version of movdi_internal2 that allows sign-extension. (*movdi_internal2_mips16): Name the existing mips16 movdi pattern. (movsi_internal2): Rename to movsi_internal. Add alternatives for float registers. Remove TARGET_DEBUG_H_MODE test. (movhi_internal1): Rename to movhi_internal. Don't check TARGET_DEBUG_H_MODE. Fix transposed *d and *f source constraints. (movqi_internal1): Rename to movqi_internal and remove TARGET_DEBUG_H_MODE dependency. (movsi_internal1, movhi_internal2, movqi_internal2): Remove. From-SVN: r55514
2002-07-17 11:24:08 +02:00
{
/* This delay slot will only be executed if the branch is taken.
Use INSN's delay slot if is annulled. */
if (INSN_ANNULLED_BRANCH_P (insn))
{
final_scan_insn (XVECEXP (final_sequence, 0, 1),
asm_out_file, optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (final_sequence, 0, 1)) = 1;
}
else
output_asm_insn ("nop", 0);
fprintf (asm_out_file, "\n");
}
/* Output NOT_TAKEN. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
targetm.asm_out.internal_label (asm_out_file, "L",
CODE_LABEL_NUMBER (not_taken));
return "";
}
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
/* Return the assembly code for INSN, which branches to OPERANDS[1]
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if some ordering condition is true. The condition is given by
OPERANDS[0] if !INVERTED_P, otherwise it is the inverse of
OPERANDS[0]. OPERANDS[2] is the comparison's first operand;
its second is always zero. */
const char *
mips_output_order_conditional_branch (rtx insn, rtx *operands, bool inverted_p)
{
const char *branch[2];
/* Make BRANCH[1] branch to OPERANDS[1] when the condition is true.
Make BRANCH[0] branch on the inverse condition. */
switch (GET_CODE (operands[0]))
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
{
/* These cases are equivalent to comparisons against zero. */
case LEU:
inverted_p = !inverted_p;
/* Fall through. */
case GTU:
branch[!inverted_p] = MIPS_BRANCH ("bne", "%2,%.,%1");
branch[inverted_p] = MIPS_BRANCH ("beq", "%2,%.,%1");
break;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* These cases are always true or always false. */
case LTU:
inverted_p = !inverted_p;
/* Fall through. */
case GEU:
branch[!inverted_p] = MIPS_BRANCH ("beq", "%.,%.,%1");
branch[inverted_p] = MIPS_BRANCH ("bne", "%.,%.,%1");
break;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
default:
branch[!inverted_p] = MIPS_BRANCH ("b%C0z", "%2,%1");
branch[inverted_p] = MIPS_BRANCH ("b%N0z", "%2,%1");
break;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
}
return mips_output_conditional_branch (insn, operands, branch[1], branch[0]);
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return the assembly code for DIV or DDIV instruction DIVISION, which has
the operands given by OPERANDS. Add in a divide-by-zero check if needed.
When working around R4000 and R4400 errata, we need to make sure that
the division is not immediately followed by a shift[1][2]. We also
need to stop the division from being put into a branch delay slot[3].
The easiest way to avoid both problems is to add a nop after the
division. When a divide-by-zero check is needed, this nop can be
used to fill the branch delay slot.
[1] If a double-word or a variable shift executes immediately
after starting an integer division, the shift may give an
incorrect result. See quotations of errata #16 and #28 from
"MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0"
in mips.md for details.
[2] A similar bug to [1] exists for all revisions of the
R4000 and the R4400 when run in an MC configuration.
From "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0":
"19. In this following sequence:
ddiv (or ddivu or div or divu)
dsll32 (or dsrl32, dsra32)
if an MPT stall occurs, while the divide is slipping the cpu
pipeline, then the following double shift would end up with an
incorrect result.
Workaround: The compiler needs to avoid generating any
sequence with divide followed by extended double shift."
This erratum is also present in "MIPS R4400MC Errata, Processor
Revision 1.0" and "MIPS R4400MC Errata, Processor Revision 2.0
& 3.0" as errata #10 and #4, respectively.
[3] From "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0"
(also valid for MIPS R4000MC processors):
"52. R4000SC: This bug does not apply for the R4000PC.
There are two flavors of this bug:
1) If the instruction just after divide takes an RF exception
(tlb-refill, tlb-invalid) and gets an instruction cache
miss (both primary and secondary) and the line which is
currently in secondary cache at this index had the first
data word, where the bits 5..2 are set, then R4000 would
get a wrong result for the div.
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
##1
nop
div r8, r9
------------------- # end-of page. -tlb-refill
nop
##2
nop
div r8, r9
------------------- # end-of page. -tlb-invalid
nop
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
2) If the divide is in the taken branch delay slot, where the
target takes RF exception and gets an I-cache miss for the
exception vector or where I-cache miss occurs for the
target address, under the above mentioned scenarios, the
div would get wrong results.
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
##1
j r2 # to next page mapped or unmapped
div r8,r9 # this bug would be there as long
# as there is an ICache miss and
nop # the "data pattern" is present
##2
beq r0, r0, NextPage # to Next page
div r8,r9
nop
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
This bug is present for div, divu, ddiv, and ddivu
instructions.
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
Workaround: For item 1), OS could make sure that the next page
after the divide instruction is also mapped. For item 2), the
compiler could make sure that the divide instruction is not in
the branch delay slot."
These processors have PRId values of 0x00004220 and 0x00004300 for
the R4000 and 0x00004400, 0x00004500 and 0x00004600 for the R4400. */
const char *
mips_output_division (const char *division, rtx *operands)
{
const char *s;
s = division;
if (TARGET_FIX_R4000 || TARGET_FIX_R4400)
{
output_asm_insn (s, operands);
s = "nop";
}
if (TARGET_CHECK_ZERO_DIV)
config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. * config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. (mips-sgi-irix6*): Likewise. * config/mips/iris6gas.h: New file. * gcc/config.gcc (mips-sgi-irix6*): Use it. * config/mips/mips.h (TARGET_IRIX): Provide default. (TARGET_IRIX5): Likewise. (TARGET_SGI_O32_AS): Likewise. * config/mips/iris5.h (TARGET_IRIX): Redefine as 1. (TARGET_IRIX5): Likewise. * config/mips/iris6.h (TARGET_IRIX6): Remove. (TARGET_IRIX5): Redefine as 0. * config/mips/mips.c (mips_output_external): Test for IRIX 6 O32 linker workaround with TARGET_IRIX and mips_abi instead of ASM_OUTPUT_UNDEF_FUNCTION. (mips_file_end): Inline old ASM_OUTPUT_UNDEF_FUNCTION definition, testing TARGET_IRIX and mips_abi explicitly. * config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove. * config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove undef. * config/mips/mips.c (irix_output_external_libcall): Renamed from mips_output_external_libcall. Use new TARGET_IRIX in guard. * config/mips/mips-protos.h (irix_output_external_libcall): Match this. * config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Likewise. * config/mips/iris5gas.h (HAVE_GAS_SHF_MERGE): Update comment. Define as 0. * config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define depending on mips_abi. * config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Define as 1. * config/mips/mips.c (mips_output_function_prologue): Test FUNCTION_NAME_ALREADY_DECLARED at runtime. (mips_output_function_epilogue): Likewise. (build_mips16_function_stub): Likewise. (build_mips16_call_stub): Likewise. * config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide default. * config/mips/iris6.h (DWARF2_UNWIND_INFO): Don't define for native IRIX 6 O32 assembler. (SUBTARGET_CC1_SPEC): Enforce mips2 ISA with O32 ABI. (TARGET_OS_CPP_BUILTINS): Define _ABIO32, use it to define _MIPS_SIM for O32 ABI. (DWARF2_FRAME_INFO): Don't define for native IRIX 6 O32 assembler. (ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version. (ASM_DECLARE_FUNCTION_SIZE): Move undef before redefinition. Integrate O32 version. (SUBTARGET_ASM_SPEC): Handle -mabi=32. (SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with O32 ABI. (BSS_SECTION_ASM_OP_32): Define. (BSS_SECTION_ASM_OP_64): Likewise. (BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs using them. (TARGET_ASM_NAMED_SECTION): Reflect renaming. Move up to allow override for O32 ABI without GNU as. (EH_FRAME_SECTION_NAME): Define explicitly. (MUST_USE_SJLJ_EXCEPTIONS): Define. [_MIPS_SIM == _ABIO32 && !GAS] (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Dummy definitions. (TARGET_ASM_NAMED_SECTION): Undef statically. (EH_FRAME_SECTION_NAME): Likewise. (ASM_OUTPUT_FILENAME): Integrate mips.h version. (LINK_SPEC): Only use default options -call_shared -no_unresolved without -r. Don't pass -init, -fini with -mabi=32. (COLLECT_PARSE_FLAG): Define. * config/mips/mips.c (iris6_asm_named_section_1): Changed guard to TARGET_IRIX. Renamed to use irix_ prefix. (iris6_asm_named_section): Likewise. (iris_section_align_entry_eq): Likewise. (iris_section_align_entry_hash): Likewise. (iris6_file_start): Likewise. (iris6_section_align_1): Likewise. (iris6_file_end): Likewise. (iris6_section_type_flags): Likewise. (iris_section_align_htab): Likewise. (iris_orig_asm_out_file): Likewise. [TARGET_IRIX] (TARGET_ASM_FILE_START): Reflect rename. (TARGET_ASM_FILE_END): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * config/mips/mips.c [TARGET_IRIX5 && !TARGET_IRIX6] (TARGET_ASM_UNALIGNED_HI_OP): Use runtime initialization in override_options instead. (TARGET_ASM_UNALIGNED_SI_OP): Likewise. (TARGET_ASM_UNALIGNED_DI_OP): Likewise. * config/mips/mips.c (override_options) [USE_COLLECT2]: Restore flag_gnu_linker to defaults without USE_COLLECT2 for non-IRIX O32 assemblers. Likewise for constructor/destructor handling. (override_options): Handle IRIX O32 assembler quirks. [TARGET_IRIX] (irix_asm_named_section): Handle O32 ABI with and without gas. (mips_file_start): Use new TARGET_IRIX. (mips_declare_object_name): No special processing for IRIX O32 assembler. (mips_finish_declare_object): Likewise. (irix_asm_output_align): Renamed from iris6_asm_output_align. Don't record alignment for O32 ABI. (irix_file_start): Renamed from iris6_file_start. Return early for O32 ABI. (irix_file_end): Renamed from iris6_file_end. Don't emit .section directives for O32 ABI. * config/mips/iris6.h (ASM_OUTPUT_ALIGN): Reflect renaming. * config/mips/mips-protos.h (irix_asm_output_align): Likewise. * config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32. (MULTILIB_OSDIRNAMES): Likewise. From-SVN: r72600
2003-10-17 13:44:33 +02:00
{
if (TARGET_MIPS16)
{
output_asm_insn (s, operands);
s = "bnez\t%2,1f\n\tbreak\t7\n1:";
}
else if (GENERATE_DIVIDE_TRAPS)
{
output_asm_insn (s, operands);
s = "teq\t%2,%.,7";
}
else
{
output_asm_insn ("%(bne\t%2,%.,1f", operands);
output_asm_insn (s, operands);
s = "break\t7%)\n1:";
}
config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. * config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas. (mips-sgi-irix6*): Likewise. * config/mips/iris6gas.h: New file. * gcc/config.gcc (mips-sgi-irix6*): Use it. * config/mips/mips.h (TARGET_IRIX): Provide default. (TARGET_IRIX5): Likewise. (TARGET_SGI_O32_AS): Likewise. * config/mips/iris5.h (TARGET_IRIX): Redefine as 1. (TARGET_IRIX5): Likewise. * config/mips/iris6.h (TARGET_IRIX6): Remove. (TARGET_IRIX5): Redefine as 0. * config/mips/mips.c (mips_output_external): Test for IRIX 6 O32 linker workaround with TARGET_IRIX and mips_abi instead of ASM_OUTPUT_UNDEF_FUNCTION. (mips_file_end): Inline old ASM_OUTPUT_UNDEF_FUNCTION definition, testing TARGET_IRIX and mips_abi explicitly. * config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove. * config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove undef. * config/mips/mips.c (irix_output_external_libcall): Renamed from mips_output_external_libcall. Use new TARGET_IRIX in guard. * config/mips/mips-protos.h (irix_output_external_libcall): Match this. * config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Likewise. * config/mips/iris5gas.h (HAVE_GAS_SHF_MERGE): Update comment. Define as 0. * config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define depending on mips_abi. * config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Define as 1. * config/mips/mips.c (mips_output_function_prologue): Test FUNCTION_NAME_ALREADY_DECLARED at runtime. (mips_output_function_epilogue): Likewise. (build_mips16_function_stub): Likewise. (build_mips16_call_stub): Likewise. * config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide default. * config/mips/iris6.h (DWARF2_UNWIND_INFO): Don't define for native IRIX 6 O32 assembler. (SUBTARGET_CC1_SPEC): Enforce mips2 ISA with O32 ABI. (TARGET_OS_CPP_BUILTINS): Define _ABIO32, use it to define _MIPS_SIM for O32 ABI. (DWARF2_FRAME_INFO): Don't define for native IRIX 6 O32 assembler. (ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version. (ASM_DECLARE_FUNCTION_SIZE): Move undef before redefinition. Integrate O32 version. (SUBTARGET_ASM_SPEC): Handle -mabi=32. (SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with O32 ABI. (BSS_SECTION_ASM_OP_32): Define. (BSS_SECTION_ASM_OP_64): Likewise. (BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs using them. (TARGET_ASM_NAMED_SECTION): Reflect renaming. Move up to allow override for O32 ABI without GNU as. (EH_FRAME_SECTION_NAME): Define explicitly. (MUST_USE_SJLJ_EXCEPTIONS): Define. [_MIPS_SIM == _ABIO32 && !GAS] (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Dummy definitions. (TARGET_ASM_NAMED_SECTION): Undef statically. (EH_FRAME_SECTION_NAME): Likewise. (ASM_OUTPUT_FILENAME): Integrate mips.h version. (LINK_SPEC): Only use default options -call_shared -no_unresolved without -r. Don't pass -init, -fini with -mabi=32. (COLLECT_PARSE_FLAG): Define. * config/mips/mips.c (iris6_asm_named_section_1): Changed guard to TARGET_IRIX. Renamed to use irix_ prefix. (iris6_asm_named_section): Likewise. (iris_section_align_entry_eq): Likewise. (iris_section_align_entry_hash): Likewise. (iris6_file_start): Likewise. (iris6_section_align_1): Likewise. (iris6_file_end): Likewise. (iris6_section_type_flags): Likewise. (iris_section_align_htab): Likewise. (iris_orig_asm_out_file): Likewise. [TARGET_IRIX] (TARGET_ASM_FILE_START): Reflect rename. (TARGET_ASM_FILE_END): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * config/mips/mips.c [TARGET_IRIX5 && !TARGET_IRIX6] (TARGET_ASM_UNALIGNED_HI_OP): Use runtime initialization in override_options instead. (TARGET_ASM_UNALIGNED_SI_OP): Likewise. (TARGET_ASM_UNALIGNED_DI_OP): Likewise. * config/mips/mips.c (override_options) [USE_COLLECT2]: Restore flag_gnu_linker to defaults without USE_COLLECT2 for non-IRIX O32 assemblers. Likewise for constructor/destructor handling. (override_options): Handle IRIX O32 assembler quirks. [TARGET_IRIX] (irix_asm_named_section): Handle O32 ABI with and without gas. (mips_file_start): Use new TARGET_IRIX. (mips_declare_object_name): No special processing for IRIX O32 assembler. (mips_finish_declare_object): Likewise. (irix_asm_output_align): Renamed from iris6_asm_output_align. Don't record alignment for O32 ABI. (irix_file_start): Renamed from iris6_file_start. Return early for O32 ABI. (irix_file_end): Renamed from iris6_file_end. Don't emit .section directives for O32 ABI. * config/mips/iris6.h (ASM_OUTPUT_ALIGN): Reflect renaming. * config/mips/mips-protos.h (irix_asm_output_align): Likewise. * config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32. (MULTILIB_OSDIRNAMES): Likewise. From-SVN: r72600
2003-10-17 13:44:33 +02:00
}
return s;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Return true if IN_INSN is a multiply-add or multiply-subtract
instruction and if OUT_INSN assigns to the accumulator operand. */
bool
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_linked_madd_p (rtx out_insn, rtx in_insn)
{
rtx x;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
x = single_set (in_insn);
if (x == 0)
return false;
x = SET_SRC (x);
if (GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x, 0)) == MULT
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& reg_set_p (XEXP (x, 1), out_insn))
return true;
if (GET_CODE (x) == MINUS
&& GET_CODE (XEXP (x, 1)) == MULT
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
&& reg_set_p (XEXP (x, 0), out_insn))
return true;
return false;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* True if the dependency between OUT_INSN and IN_INSN is on the store
data rather than the address. We need this because the cprestore
pattern is type "store", but is defined using an UNSPEC_VOLATILE,
which causes the default routine to abort. We just return false
for that case. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
bool
mips_store_data_bypass_p (rtx out_insn, rtx in_insn)
{
if (GET_CODE (PATTERN (in_insn)) == UNSPEC_VOLATILE)
return false;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return !store_data_bypass_p (out_insn, in_insn);
}
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
/* Variables and flags used in scheduler hooks when tuning for
Loongson 2E/2F. */
static struct
{
/* Variables to support Loongson 2E/2F round-robin [F]ALU1/2 dispatch
strategy. */
/* If true, then next ALU1/2 instruction will go to ALU1. */
bool alu1_turn_p;
/* If true, then next FALU1/2 unstruction will go to FALU1. */
bool falu1_turn_p;
/* Codes to query if [f]alu{1,2}_core units are subscribed or not. */
int alu1_core_unit_code;
int alu2_core_unit_code;
int falu1_core_unit_code;
int falu2_core_unit_code;
/* True if current cycle has a multi instruction.
This flag is used in mips_ls2_dfa_post_advance_cycle. */
bool cycle_has_multi_p;
/* Instructions to subscribe ls2_[f]alu{1,2}_turn_enabled units.
These are used in mips_ls2_dfa_post_advance_cycle to initialize
DFA state.
E.g., when alu1_turn_enabled_insn is issued it makes next ALU1/2
instruction to go ALU1. */
rtx alu1_turn_enabled_insn;
rtx alu2_turn_enabled_insn;
rtx falu1_turn_enabled_insn;
rtx falu2_turn_enabled_insn;
} mips_ls2;
/* Implement TARGET_SCHED_ADJUST_COST. We assume that anti and output
dependencies have no cost, except on the 20Kc where output-dependence
is treated like input-dependence. */
static int
mips_adjust_cost (rtx insn ATTRIBUTE_UNUSED, rtx link,
rtx dep ATTRIBUTE_UNUSED, int cost)
{
if (REG_NOTE_KIND (link) == REG_DEP_OUTPUT
&& TUNE_20KC)
return cost;
if (REG_NOTE_KIND (link) != 0)
return 0;
return cost;
}
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
/* Return the number of instructions that can be issued per cycle. */
static int
mips_issue_rate (void)
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
{
switch (mips_tune)
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
{
case PROCESSOR_74KC:
case PROCESSOR_74KF2_1:
case PROCESSOR_74KF1_1:
case PROCESSOR_74KF3_2:
/* The 74k is not strictly quad-issue cpu, but can be seen as one
by the scheduler. It can issue 1 ALU, 1 AGEN and 2 FPU insns,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
but in reality only a maximum of 3 insns can be issued as
floating-point loads and stores also require a slot in the
AGEN pipe. */
return 4;
case PROCESSOR_20KC:
case PROCESSOR_R4130:
case PROCESSOR_R5400:
case PROCESSOR_R5500:
case PROCESSOR_R7000:
case PROCESSOR_R9000:
return 2;
case PROCESSOR_SB1:
case PROCESSOR_SB1A:
/* This is actually 4, but we get better performance if we claim 3.
This is partly because of unwanted speculative code motion with the
larger number, and partly because in most common cases we can't
reach the theoretical max of 4. */
return 3;
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
case PROCESSOR_LOONGSON_2E:
case PROCESSOR_LOONGSON_2F:
return 4;
default:
return 1;
Fix up MIPS16 hard float and add support for complex. 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> gcc/ Fix up MIPS16 hard float and add support for complex. * config/mips/mips.h (TARGET_HARD_FLOAT_ABI): New. (TARGET_SOFT_FLOAT_ABI): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_hard_float and __mips_soft_float to reflect the ABI in use, not whether the FPU is directly accessible (e.g., in MIPS16 mode). (UNITS_PER_HWFPVALUE): Use TARGET_SOFT_FLOAT_ABI. (UNITS_PER_FPVALUE): Likewise. * config/mips/mips.c (mips_expand_call): Remove redundant TARGET_MIPS16 check. (mips_arg_regno): New. (function_arg_advance): When setting bits in cum->fp_code for MIPS16, don't subtract 1 from cum->arg_number, since it is now zero-based. (function_arg): Use mips_arg_regno. (mips_return_mode_in_fpr_p): New. (mips16_call_stub_mode_suffix): New. (mips16_cfun_returns_in_fpr_p): New. (mips_save_reg_p): Use mips16_cfun_returns_in_fpr_p. (mips_output_function_prologue): Test mips16_hard_float, not !TARGET_SOFT_FLOAT, to decide when a function stub is required. (mips_expand_epilogue): Call MIPS16 helper routines to copy return value into a floating-point register. (mips_can_use_return_insn): Use mips16_cfun_returns_in_fpr_p. (mips_function_value): Rewrite to use mips_return_mode_in_fpr_p. (mips16_fp_args): Handle MIPS32r2 ISA which supports TARGET_FLOAT64, and use mfhc1/mthc1 to copy the most significant word of double arguments from or to the high bits of 64-bit floating point registers. (build_mips16_function_stub): Fill in DECL_RESULT for stubdecl. (mips16_fpret_double): New helper function. (build_mips16_call_stub): Use mips16_return_mode_in_fpr_p. Add support for complex modes. Fill in DECL_RESULT for stubdecl. (mips_init_libfuncs): Remove redundant TARGET_MIPS16 check. * config/mips/mips16.S (RET, ARG1, ARG2): New. (MERGE_GPRf, MERGE_GPRt): New. (DELAYt, DELAYf): New. (MOVE_SF_BYTE0, MOVE_SI_BYTE0): New. (MOVE_SF_BYTE4, MOVE_SF_BYTE8): New. (MOVE_DF_BYTE0, MOVE_DF_BYTE8): New. (MOVE_SF_RET, MOVE_SC_RET, MOVE_DF_RET, MOVE_DC_RET, MOVE_SI_RET): New. (SFOP): Renamed to... (OPSF3): This, and macro-ified. Updated all uses. (SFOP2): Renamed to... (OPSF2): This, and macro-ified. Updated all uses. (SFCMP): Renamed to... (CMPSF): This, and macro-ified. Updated all uses. (SFREVCMP): Renamed to... (REVCMPSF): This, and macro-ified. Updated all uses. (__mips16_floatsisf, __mips16_fix_truncsfsi): Macro-ified. (LDDBL1, LDDBL2, RETDBL): Deleted. (DFOP): Renamed to... (OPDF3): This, and macro-ified. Updated all uses. (DFOP2): Renamed to... (OPDF2): This, and macro-ified. Updated all uses. (__mips16_extendsfdf2, __mips16_truncdfsf2): Macro-ified. (DFCMP): Renamed to... (CMPDF): This, and macro-ified. Updated all uses. (DFREVCMP): Renamed to... (REVCMPDF): This, and macro-ified. Updated all uses. (__mips16_floatsidf, __mips16_fix_truncdfsi): Macro-ified. (RET_FUNCTION): New. (__mips16_ret_sf, __mips16_ret_df): Macro-ified. (__mips16_ret_sc, __mips16_ret_dc): New. (STUB_ARGS_0, STUB_ARGS_1, STUB_ARGS_5, STUB_ARGS_9, STUB_ARGS_2, STUB_ARGS_6, STUB_ARGS_10): New. (CALL_STUB_NO_RET): New. (__mips16_call_stub_1): Macro-ified. (__mips16_call_stub_5): Macro-ified. (__mips16_call_stub_2): Macro-ified. (__mips16_call_stub_6): Macro-ified. (__mips16_call_stub_9): Macro-ified. (__mips16_call_stub_10): Macro-ified. (CALL_STUB_RET): New. (__mips16_call_stub_sf_0): Macro-ified. (__mips16_call_stub_sf_1): Macro-ified. (__mips16_call_stub_sf_5): Macro-ified. (__mips16_call_stub_sf_2): Macro-ified. (__mips16_call_stub_sf_6): Macro-ified. (__mips16_call_stub_sf_9): Macro-ified. (__mips16_call_stub_sf_10): Macro-ified. (__mips16_call_stub_df_0): Macro-ified. (__mips16_call_stub_df_1): Macro-ified. (__mips16_call_stub_df_5): Macro-ified. (__mips16_call_stub_df_2): Macro-ified. (__mips16_call_stub_df_6): Macro-ified. (__mips16_call_stub_df_9): Macro-ified. (__mips16_call_stub_df_10): Macro-ified. (__mips16_call_stub_sc_0): New. (__mips16_call_stub_sc_1): New. (__mips16_call_stub_sc_5): New. (__mips16_call_stub_sc_2): New. (__mips16_call_stub_sc_6): New. (__mips16_call_stub_sc_9): New. (__mips16_call_stub_sc_10): New. (__mips16_call_stub_dc_0): New. (__mips16_call_stub_dc_1): New. (__mips16_call_stub_dc_5): New. (__mips16_call_stub_dc_2): New. (__mips16_call_stub_dc_6): New. (__mips16_call_stub_dc_9): New. (__mips16_call_stub_dc_10): New. * config/mips/t-elf (LIB1ASMFUNCS): Add MIPS16 floating-point stubs. * config/mips/t-isa3264 (LIB1ASMFUNCS): Likewise. * config/mips/t-r2900 (LIB1ASMFUNCS): Likewise. gcc/testsuite/ * gcc.target/mips/inter/mips16_stubs_1_main.c: New. * gcc.target/mips/inter/mips16_stubs_1_x.c: New. * gcc.target/mips/inter/mips16_stubs_1_y.c: New. * gcc.target/mips/inter/mips16-inter.exp: New. Co-Authored-By: Nigel Stephens <nigel@mips.com> Co-Authored-By: Richard Sandiford <richard@codesourcery.com> From-SVN: r124999
2007-05-23 22:03:00 +02:00
}
}
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
/* Implement TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN hook for Loongson2. */
static void
mips_ls2_init_dfa_post_cycle_insn (void)
{
start_sequence ();
emit_insn (gen_ls2_alu1_turn_enabled_insn ());
mips_ls2.alu1_turn_enabled_insn = get_insns ();
end_sequence ();
start_sequence ();
emit_insn (gen_ls2_alu2_turn_enabled_insn ());
mips_ls2.alu2_turn_enabled_insn = get_insns ();
end_sequence ();
start_sequence ();
emit_insn (gen_ls2_falu1_turn_enabled_insn ());
mips_ls2.falu1_turn_enabled_insn = get_insns ();
end_sequence ();
start_sequence ();
emit_insn (gen_ls2_falu2_turn_enabled_insn ());
mips_ls2.falu2_turn_enabled_insn = get_insns ();
end_sequence ();
mips_ls2.alu1_core_unit_code = get_cpu_unit_code ("ls2_alu1_core");
mips_ls2.alu2_core_unit_code = get_cpu_unit_code ("ls2_alu2_core");
mips_ls2.falu1_core_unit_code = get_cpu_unit_code ("ls2_falu1_core");
mips_ls2.falu2_core_unit_code = get_cpu_unit_code ("ls2_falu2_core");
}
/* Implement TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN hook.
Init data used in mips_dfa_post_advance_cycle. */
static void
mips_init_dfa_post_cycle_insn (void)
{
if (TUNE_LOONGSON_2EF)
mips_ls2_init_dfa_post_cycle_insn ();
}
/* Initialize STATE when scheduling for Loongson 2E/2F.
Support round-robin dispatch scheme by enabling only one of
ALU1/ALU2 and one of FALU1/FALU2 units for ALU1/2 and FALU1/2 instructions
respectively. */
static void
mips_ls2_dfa_post_advance_cycle (state_t state)
{
if (cpu_unit_reservation_p (state, mips_ls2.alu1_core_unit_code))
{
/* Though there are no non-pipelined ALU1 insns,
we can get an instruction of type 'multi' before reload. */
gcc_assert (mips_ls2.cycle_has_multi_p);
mips_ls2.alu1_turn_p = false;
}
mips_ls2.cycle_has_multi_p = false;
if (cpu_unit_reservation_p (state, mips_ls2.alu2_core_unit_code))
/* We have a non-pipelined alu instruction in the core,
adjust round-robin counter. */
mips_ls2.alu1_turn_p = true;
if (mips_ls2.alu1_turn_p)
{
if (state_transition (state, mips_ls2.alu1_turn_enabled_insn) >= 0)
gcc_unreachable ();
}
else
{
if (state_transition (state, mips_ls2.alu2_turn_enabled_insn) >= 0)
gcc_unreachable ();
}
if (cpu_unit_reservation_p (state, mips_ls2.falu1_core_unit_code))
{
/* There are no non-pipelined FALU1 insns. */
gcc_unreachable ();
mips_ls2.falu1_turn_p = false;
}
if (cpu_unit_reservation_p (state, mips_ls2.falu2_core_unit_code))
/* We have a non-pipelined falu instruction in the core,
adjust round-robin counter. */
mips_ls2.falu1_turn_p = true;
if (mips_ls2.falu1_turn_p)
{
if (state_transition (state, mips_ls2.falu1_turn_enabled_insn) >= 0)
gcc_unreachable ();
}
else
{
if (state_transition (state, mips_ls2.falu2_turn_enabled_insn) >= 0)
gcc_unreachable ();
}
}
/* Implement TARGET_SCHED_DFA_POST_ADVANCE_CYCLE.
This hook is being called at the start of each cycle. */
static void
mips_dfa_post_advance_cycle (void)
{
if (TUNE_LOONGSON_2EF)
mips_ls2_dfa_post_advance_cycle (curr_state);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD. This should
be as wide as the scheduling freedom in the DFA. */
static int
mips_multipass_dfa_lookahead (void)
{
/* Can schedule up to 4 of the 6 function units in any one cycle. */
if (TUNE_SB1)
return 4;
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
if (TUNE_LOONGSON_2EF)
return 4;
return 0;
}
/* Remove the instruction at index LOWER from ready queue READY and
reinsert it in front of the instruction at index HIGHER. LOWER must
be <= HIGHER. */
static void
mips_promote_ready (rtx *ready, int lower, int higher)
{
rtx new_head;
int i;
new_head = ready[lower];
for (i = lower; i < higher; i++)
ready[i] = ready[i + 1];
ready[i] = new_head;
}
/* If the priority of the instruction at POS2 in the ready queue READY
is within LIMIT units of that of the instruction at POS1, swap the
instructions if POS2 is not already less than POS1. */
static void
mips_maybe_swap_ready (rtx *ready, int pos1, int pos2, int limit)
{
if (pos1 < pos2
&& INSN_PRIORITY (ready[pos1]) + limit >= INSN_PRIORITY (ready[pos2]))
{
rtx temp;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
temp = ready[pos1];
ready[pos1] = ready[pos2];
ready[pos2] = temp;
}
}
/* Used by TUNE_MACC_CHAINS to record the last scheduled instruction
that may clobber hi or lo. */
static rtx mips_macc_chains_last_hilo;
/* A TUNE_MACC_CHAINS helper function. Record that instruction INSN has
been scheduled, updating mips_macc_chains_last_hilo appropriately. */
static void
mips_macc_chains_record (rtx insn)
{
if (get_attr_may_clobber_hilo (insn))
mips_macc_chains_last_hilo = insn;
}
/* A TUNE_MACC_CHAINS helper function. Search ready queue READY, which
has NREADY elements, looking for a multiply-add or multiply-subtract
instruction that is cumulative with mips_macc_chains_last_hilo.
If there is one, promote it ahead of anything else that might
clobber hi or lo. */
static void
mips_macc_chains_reorder (rtx *ready, int nready)
{
int i, j;
if (mips_macc_chains_last_hilo != 0)
for (i = nready - 1; i >= 0; i--)
if (mips_linked_madd_p (mips_macc_chains_last_hilo, ready[i]))
{
for (j = nready - 1; j > i; j--)
if (recog_memoized (ready[j]) >= 0
&& get_attr_may_clobber_hilo (ready[j]))
{
mips_promote_ready (ready, i, j);
break;
}
break;
}
}
/* The last instruction to be scheduled. */
static rtx vr4130_last_insn;
/* A note_stores callback used by vr4130_true_reg_dependence_p. DATA
points to an rtx that is initially an instruction. Nullify the rtx
if the instruction uses the value of register X. */
static void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
vr4130_true_reg_dependence_p_1 (rtx x, const_rtx pat ATTRIBUTE_UNUSED,
void *data)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
rtx *insn_ptr;
insn_ptr = (rtx *) data;
if (REG_P (x)
&& *insn_ptr != 0
&& reg_referenced_p (x, PATTERN (*insn_ptr)))
*insn_ptr = 0;
}
/* Return true if there is true register dependence between vr4130_last_insn
and INSN. */
static bool
vr4130_true_reg_dependence_p (rtx insn)
{
note_stores (PATTERN (vr4130_last_insn),
vr4130_true_reg_dependence_p_1, &insn);
return insn == 0;
}
/* A TUNE_MIPS4130 helper function. Given that INSN1 is at the head of
the ready queue and that INSN2 is the instruction after it, return
true if it is worth promoting INSN2 ahead of INSN1. Look for cases
in which INSN1 and INSN2 can probably issue in parallel, but for
which (INSN2, INSN1) should be less sensitive to instruction
alignment than (INSN1, INSN2). See 4130.md for more details. */
static bool
vr4130_swap_insns_p (rtx insn1, rtx insn2)
{
sd_iterator_def sd_it;
dep_t dep;
/* Check for the following case:
1) there is some other instruction X with an anti dependence on INSN1;
2) X has a higher priority than INSN2; and
3) X is an arithmetic instruction (and thus has no unit restrictions).
If INSN1 is the last instruction blocking X, it would better to
choose (INSN1, X) over (INSN2, INSN1). */
FOR_EACH_DEP (insn1, SD_LIST_FORW, sd_it, dep)
if (DEP_TYPE (dep) == REG_DEP_ANTI
&& INSN_PRIORITY (DEP_CON (dep)) > INSN_PRIORITY (insn2)
&& recog_memoized (DEP_CON (dep)) >= 0
&& get_attr_vr4130_class (DEP_CON (dep)) == VR4130_CLASS_ALU)
return false;
if (vr4130_last_insn != 0
&& recog_memoized (insn1) >= 0
&& recog_memoized (insn2) >= 0)
{
/* See whether INSN1 and INSN2 use different execution units,
or if they are both ALU-type instructions. If so, they can
probably execute in parallel. */
enum attr_vr4130_class class1 = get_attr_vr4130_class (insn1);
enum attr_vr4130_class class2 = get_attr_vr4130_class (insn2);
if (class1 != class2 || class1 == VR4130_CLASS_ALU)
{
/* If only one of the instructions has a dependence on
vr4130_last_insn, prefer to schedule the other one first. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
bool dep1_p = vr4130_true_reg_dependence_p (insn1);
bool dep2_p = vr4130_true_reg_dependence_p (insn2);
if (dep1_p != dep2_p)
return dep1_p;
/* Prefer to schedule INSN2 ahead of INSN1 if vr4130_last_insn
is not an ALU-type instruction and if INSN1 uses the same
execution unit. (Note that if this condition holds, we already
know that INSN2 uses a different execution unit.) */
if (class1 != VR4130_CLASS_ALU
&& recog_memoized (vr4130_last_insn) >= 0
&& class1 == get_attr_vr4130_class (vr4130_last_insn))
return true;
}
}
return false;
}
/* A TUNE_MIPS4130 helper function. (READY, NREADY) describes a ready
queue with at least two instructions. Swap the first two if
vr4130_swap_insns_p says that it could be worthwhile. */
static void
vr4130_reorder (rtx *ready, int nready)
{
if (vr4130_swap_insns_p (ready[nready - 1], ready[nready - 2]))
mips_promote_ready (ready, nready - 2, nready - 1);
}
/* Record whether last 74k AGEN instruction was a load or store. */
static enum attr_type mips_last_74k_agen_insn = TYPE_UNKNOWN;
/* Initialize mips_last_74k_agen_insn from INSN. A null argument
resets to TYPE_UNKNOWN state. */
static void
mips_74k_agen_init (rtx insn)
{
if (!insn || !NONJUMP_INSN_P (insn))
mips_last_74k_agen_insn = TYPE_UNKNOWN;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
else
{
enum attr_type type = get_attr_type (insn);
if (type == TYPE_LOAD || type == TYPE_STORE)
mips_last_74k_agen_insn = type;
}
}
/* A TUNE_74K helper function. The 74K AGEN pipeline likes multiple
loads to be grouped together, and multiple stores to be grouped
together. Swap things around in the ready queue to make this happen. */
static void
mips_74k_agen_reorder (rtx *ready, int nready)
{
int i;
int store_pos, load_pos;
store_pos = -1;
load_pos = -1;
for (i = nready - 1; i >= 0; i--)
{
rtx insn = ready[i];
if (USEFUL_INSN_P (insn))
switch (get_attr_type (insn))
{
case TYPE_STORE:
if (store_pos == -1)
store_pos = i;
break;
case TYPE_LOAD:
if (load_pos == -1)
load_pos = i;
break;
default:
break;
}
}
if (load_pos == -1 || store_pos == -1)
return;
switch (mips_last_74k_agen_insn)
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
{
case TYPE_UNKNOWN:
/* Prefer to schedule loads since they have a higher latency. */
case TYPE_LOAD:
/* Swap loads to the front of the queue. */
mips_maybe_swap_ready (ready, load_pos, store_pos, 4);
break;
case TYPE_STORE:
/* Swap stores to the front of the queue. */
mips_maybe_swap_ready (ready, store_pos, load_pos, 4);
break;
default:
break;
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
}
}
/* Implement TARGET_SCHED_INIT. */
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
static void
mips_sched_init (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED,
int max_ready ATTRIBUTE_UNUSED)
{
mips_macc_chains_last_hilo = 0;
vr4130_last_insn = 0;
mips_74k_agen_init (NULL_RTX);
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
/* When scheduling for Loongson2, branch instructions go to ALU1,
therefore basic block is most likely to start with round-robin counter
pointed to ALU2. */
mips_ls2.alu1_turn_p = false;
mips_ls2.falu1_turn_p = true;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_SCHED_REORDER and TARGET_SCHED_REORDER2. */
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
static int
mips_sched_reorder (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED,
rtx *ready, int *nreadyp, int cycle ATTRIBUTE_UNUSED)
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
{
if (!reload_completed
&& TUNE_MACC_CHAINS
&& *nreadyp > 0)
mips_macc_chains_reorder (ready, *nreadyp);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (reload_completed
&& TUNE_MIPS4130
&& !TARGET_VR4130_ALIGN
&& *nreadyp > 1)
vr4130_reorder (ready, *nreadyp);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TUNE_74K)
mips_74k_agen_reorder (ready, *nreadyp);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return mips_issue_rate ();
}
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
/* Update round-robin counters for ALU1/2 and FALU1/2. */
static void
mips_ls2_variable_issue (rtx insn)
{
if (mips_ls2.alu1_turn_p)
{
if (cpu_unit_reservation_p (curr_state, mips_ls2.alu1_core_unit_code))
mips_ls2.alu1_turn_p = false;
}
else
{
if (cpu_unit_reservation_p (curr_state, mips_ls2.alu2_core_unit_code))
mips_ls2.alu1_turn_p = true;
}
if (mips_ls2.falu1_turn_p)
{
if (cpu_unit_reservation_p (curr_state, mips_ls2.falu1_core_unit_code))
mips_ls2.falu1_turn_p = false;
}
else
{
if (cpu_unit_reservation_p (curr_state, mips_ls2.falu2_core_unit_code))
mips_ls2.falu1_turn_p = true;
}
if (recog_memoized (insn) >= 0)
mips_ls2.cycle_has_multi_p |= (get_attr_type (insn) == TYPE_MULTI);
}
/* Implement TARGET_SCHED_VARIABLE_ISSUE. */
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
static int
mips_variable_issue (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED,
rtx insn, int more)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Ignore USEs and CLOBBERs; don't count them against the issue rate. */
if (USEFUL_INSN_P (insn))
{
more--;
if (!reload_completed && TUNE_MACC_CHAINS)
mips_macc_chains_record (insn);
vr4130_last_insn = insn;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TUNE_74K)
mips_74k_agen_init (insn);
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
else if (TUNE_LOONGSON_2EF)
mips_ls2_variable_issue (insn);
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
}
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
/* Instructions of type 'multi' should all be split before
the second scheduling pass. */
gcc_assert (!reload_completed
|| recog_memoized (insn) < 0
|| get_attr_type (insn) != TYPE_MULTI);
return more;
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
}
/* Given that we have an rtx of the form (prefetch ... WRITE LOCALITY),
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return the first operand of the associated PREF or PREFX insn. */
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
rtx
mips_prefetch_cookie (rtx write, rtx locality)
{
/* store_streamed / load_streamed. */
if (INTVAL (locality) <= 0)
return GEN_INT (INTVAL (write) + 4);
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
/* store / load. */
if (INTVAL (locality) <= 2)
return write;
/* store_retained / load_retained. */
return GEN_INT (INTVAL (write) + 6);
}
/* Flags that indicate when a built-in function is available.
BUILTIN_AVAIL_NON_MIPS16
The function is available on the current target, but only
in non-MIPS16 mode. */
#define BUILTIN_AVAIL_NON_MIPS16 1
/* Declare an availability predicate for built-in functions that
require non-MIPS16 mode and also require COND to be true.
NAME is the main part of the predicate's name. */
#define AVAIL_NON_MIPS16(NAME, COND) \
static unsigned int \
mips_builtin_avail_##NAME (void) \
{ \
return (COND) ? BUILTIN_AVAIL_NON_MIPS16 : 0; \
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* This structure describes a single built-in function. */
struct mips_builtin_description {
/* The code of the main .md file instruction. See mips_builtin_type
for more information. */
enum insn_code icode;
/* The floating-point comparison code to use with ICODE, if any. */
enum mips_fp_condition cond;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The name of the built-in function. */
const char *name;
/* Specifies how the function should be expanded. */
enum mips_builtin_type builtin_type;
/* The function's prototype. */
enum mips_function_type function_type;
/* Whether the function is available. */
unsigned int (*avail) (void);
};
mips-protos.h (m16_usym8_4, [...]): Delete. * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. * config/mips/mips.h (mips_entry, mips_string_length): Delete. (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. * config/mips/mips.c (struct mips16_constant): Renamed from struct constant. Propogate change throughout file. (struct machine_function): Remove insns_len. (mips_string_length, mips16_strings, string_constants): Delete. (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs when generating mips16 code. Remove special mips16 treatment of string constants. (mips_symbolic_constant_p): Allow mips16 constant pool accesses to have the form LABEL+CONSTANT. (mips_symbolic_address_p): Fix comment. (m16_usym8_4, m16_usym5_4): Delete. (mips_output_function_epilogue): Remove mips16 string handling. (mips_output_mi_thunk): Call mips16_lay_out_constants. (mips_select_section, mips_encode_section_info): Remove mips16 string handling. (struct mips16_constant_pool): New. (add_constant): Take a mips16_constant_pool structure. Keep pool sorted into order of ascending mode size. Keep track of the highest possible start address, taking padding and the masking of the base PC value into account. (dump_constants_1): New function, split out from dump_constants. Handle vector constants. Use gen_consttable_{int,float} rather than separate functions for each mode. (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align rather than separate functions for each alignment. (mips_find_symbol): Delete. (mips16_insn_length): New function, split out from mips16_lay_out_constants. (mips16_rewrite_pool_refs): New function. (mips16_lay_out_constants): Rework. Remove string handling. Always create an inline constant pool. * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) (UNSPEC_ALIGN): New constants. (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. (UNSPEC_ALIGN_[248]): Delete. (consttable_int, consttable_float, align): New patterns. (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. From-SVN: r80814
2004-04-18 10:22:38 +02:00
AVAIL_NON_MIPS16 (paired_single, TARGET_PAIRED_SINGLE_FLOAT)
AVAIL_NON_MIPS16 (sb1_paired_single, TARGET_SB1 && TARGET_PAIRED_SINGLE_FLOAT)
AVAIL_NON_MIPS16 (mips3d, TARGET_MIPS3D)
AVAIL_NON_MIPS16 (dsp, TARGET_DSP)
AVAIL_NON_MIPS16 (dspr2, TARGET_DSPR2)
AVAIL_NON_MIPS16 (dsp_32, !TARGET_64BIT && TARGET_DSP)
AVAIL_NON_MIPS16 (dspr2_32, !TARGET_64BIT && TARGET_DSPR2)
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
AVAIL_NON_MIPS16 (loongson, TARGET_LOONGSON_VECTORS)
/* Construct a mips_builtin_description from the given arguments.
INSN is the name of the associated instruction pattern, without the
leading CODE_FOR_mips_.
CODE is the floating-point condition code associated with the
function. It can be 'f' if the field is not applicable.
NAME is the name of the function itself, without the leading
"__builtin_mips_".
BUILTIN_TYPE and FUNCTION_TYPE are mips_builtin_description fields.
AVAIL is the name of the availability predicate, without the leading
mips_builtin_avail_. */
#define MIPS_BUILTIN(INSN, COND, NAME, BUILTIN_TYPE, \
FUNCTION_TYPE, AVAIL) \
{ CODE_FOR_mips_ ## INSN, MIPS_FP_COND_ ## COND, \
"__builtin_mips_" NAME, BUILTIN_TYPE, FUNCTION_TYPE, \
mips_builtin_avail_ ## AVAIL }
/* Define __builtin_mips_<INSN>, which is a MIPS_BUILTIN_DIRECT function
mapped to instruction CODE_FOR_mips_<INSN>, FUNCTION_TYPE and AVAIL
are as for MIPS_BUILTIN. */
#define DIRECT_BUILTIN(INSN, FUNCTION_TYPE, AVAIL) \
MIPS_BUILTIN (INSN, f, #INSN, MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, AVAIL)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Define __builtin_mips_<INSN>_<COND>_{s,d} functions, both of which
are subject to mips_builtin_avail_<AVAIL>. */
#define CMP_SCALAR_BUILTINS(INSN, COND, AVAIL) \
MIPS_BUILTIN (INSN ## _cond_s, COND, #INSN "_" #COND "_s", \
MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_SF_SF, AVAIL), \
MIPS_BUILTIN (INSN ## _cond_d, COND, #INSN "_" #COND "_d", \
MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_DF_DF, AVAIL)
/* Define __builtin_mips_{any,all,upper,lower}_<INSN>_<COND>_ps.
The lower and upper forms are subject to mips_builtin_avail_<AVAIL>
while the any and all forms are subject to mips_builtin_avail_mips3d. */
#define CMP_PS_BUILTINS(INSN, COND, AVAIL) \
MIPS_BUILTIN (INSN ## _cond_ps, COND, "any_" #INSN "_" #COND "_ps", \
MIPS_BUILTIN_CMP_ANY, MIPS_INT_FTYPE_V2SF_V2SF, \
mips3d), \
MIPS_BUILTIN (INSN ## _cond_ps, COND, "all_" #INSN "_" #COND "_ps", \
MIPS_BUILTIN_CMP_ALL, MIPS_INT_FTYPE_V2SF_V2SF, \
mips3d), \
MIPS_BUILTIN (INSN ## _cond_ps, COND, "lower_" #INSN "_" #COND "_ps", \
MIPS_BUILTIN_CMP_LOWER, MIPS_INT_FTYPE_V2SF_V2SF, \
AVAIL), \
MIPS_BUILTIN (INSN ## _cond_ps, COND, "upper_" #INSN "_" #COND "_ps", \
MIPS_BUILTIN_CMP_UPPER, MIPS_INT_FTYPE_V2SF_V2SF, \
AVAIL)
/* Define __builtin_mips_{any,all}_<INSN>_<COND>_4s. The functions
are subject to mips_builtin_avail_mips3d. */
#define CMP_4S_BUILTINS(INSN, COND) \
MIPS_BUILTIN (INSN ## _cond_4s, COND, "any_" #INSN "_" #COND "_4s", \
MIPS_BUILTIN_CMP_ANY, \
MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, mips3d), \
MIPS_BUILTIN (INSN ## _cond_4s, COND, "all_" #INSN "_" #COND "_4s", \
MIPS_BUILTIN_CMP_ALL, \
MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, mips3d)
/* Define __builtin_mips_mov{t,f}_<INSN>_<COND>_ps. The comparison
instruction requires mips_builtin_avail_<AVAIL>. */
#define MOVTF_BUILTINS(INSN, COND, AVAIL) \
MIPS_BUILTIN (INSN ## _cond_ps, COND, "movt_" #INSN "_" #COND "_ps", \
MIPS_BUILTIN_MOVT, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \
AVAIL), \
MIPS_BUILTIN (INSN ## _cond_ps, COND, "movf_" #INSN "_" #COND "_ps", \
MIPS_BUILTIN_MOVF, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \
AVAIL)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Define all the built-in functions related to C.cond.fmt condition COND. */
#define CMP_BUILTINS(COND) \
MOVTF_BUILTINS (c, COND, paired_single), \
MOVTF_BUILTINS (cabs, COND, mips3d), \
CMP_SCALAR_BUILTINS (cabs, COND, mips3d), \
CMP_PS_BUILTINS (c, COND, paired_single), \
CMP_PS_BUILTINS (cabs, COND, mips3d), \
CMP_4S_BUILTINS (c, COND), \
CMP_4S_BUILTINS (cabs, COND)
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
/* Define __builtin_mips_<INSN>, which is a MIPS_BUILTIN_DIRECT_NO_TARGET
function mapped to instruction CODE_FOR_mips_<INSN>, FUNCTION_TYPE
and AVAIL are as for MIPS_BUILTIN. */
#define DIRECT_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, AVAIL) \
MIPS_BUILTIN (INSN, f, #INSN, MIPS_BUILTIN_DIRECT_NO_TARGET, \
FUNCTION_TYPE, AVAIL)
/* Define __builtin_mips_bposge<VALUE>. <VALUE> is 32 for the MIPS32 DSP
branch instruction. AVAIL is as for MIPS_BUILTIN. */
#define BPOSGE_BUILTIN(VALUE, AVAIL) \
MIPS_BUILTIN (bposge, f, "bposge" #VALUE, \
MIPS_BUILTIN_BPOSGE ## VALUE, MIPS_SI_FTYPE_VOID, AVAIL)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
/* Define a Loongson MIPS_BUILTIN_DIRECT function __builtin_loongson_<FN_NAME>
for instruction CODE_FOR_loongson_<INSN>. FUNCTION_TYPE is a
builtin_description field. */
#define LOONGSON_BUILTIN_ALIAS(INSN, FN_NAME, FUNCTION_TYPE) \
{ CODE_FOR_loongson_ ## INSN, 0, "__builtin_loongson_" #FN_NAME, \
MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, mips_builtin_avail_loongson }
/* Define a Loongson MIPS_BUILTIN_DIRECT function __builtin_loongson_<INSN>
for instruction CODE_FOR_loongson_<INSN>. FUNCTION_TYPE is a
builtin_description field. */
#define LOONGSON_BUILTIN(INSN, FUNCTION_TYPE) \
LOONGSON_BUILTIN_ALIAS (INSN, INSN, FUNCTION_TYPE)
/* Like LOONGSON_BUILTIN, but add _<SUFFIX> to the end of the function name.
We use functions of this form when the same insn can be usefully applied
to more than one datatype. */
#define LOONGSON_BUILTIN_SUFFIX(INSN, SUFFIX, FUNCTION_TYPE) \
LOONGSON_BUILTIN_ALIAS (INSN, INSN ## _ ## SUFFIX, FUNCTION_TYPE)
#define CODE_FOR_mips_sqrt_ps CODE_FOR_sqrtv2sf2
#define CODE_FOR_mips_addq_ph CODE_FOR_addv2hi3
#define CODE_FOR_mips_addu_qb CODE_FOR_addv4qi3
#define CODE_FOR_mips_subq_ph CODE_FOR_subv2hi3
#define CODE_FOR_mips_subu_qb CODE_FOR_subv4qi3
#define CODE_FOR_mips_mul_ph CODE_FOR_mulv2hi3
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
#define CODE_FOR_loongson_packsswh CODE_FOR_vec_pack_ssat_v2si
#define CODE_FOR_loongson_packsshb CODE_FOR_vec_pack_ssat_v4hi
#define CODE_FOR_loongson_packushb CODE_FOR_vec_pack_usat_v4hi
#define CODE_FOR_loongson_paddw CODE_FOR_addv2si3
#define CODE_FOR_loongson_paddh CODE_FOR_addv4hi3
#define CODE_FOR_loongson_paddb CODE_FOR_addv8qi3
#define CODE_FOR_loongson_paddsh CODE_FOR_ssaddv4hi3
#define CODE_FOR_loongson_paddsb CODE_FOR_ssaddv8qi3
#define CODE_FOR_loongson_paddush CODE_FOR_usaddv4hi3
#define CODE_FOR_loongson_paddusb CODE_FOR_usaddv8qi3
#define CODE_FOR_loongson_pmaxsh CODE_FOR_smaxv4hi3
#define CODE_FOR_loongson_pmaxub CODE_FOR_umaxv8qi3
#define CODE_FOR_loongson_pminsh CODE_FOR_sminv4hi3
#define CODE_FOR_loongson_pminub CODE_FOR_uminv8qi3
#define CODE_FOR_loongson_pmulhuh CODE_FOR_umulv4hi3_highpart
#define CODE_FOR_loongson_pmulhh CODE_FOR_smulv4hi3_highpart
#define CODE_FOR_loongson_biadd CODE_FOR_reduc_uplus_v8qi
#define CODE_FOR_loongson_psubw CODE_FOR_subv2si3
#define CODE_FOR_loongson_psubh CODE_FOR_subv4hi3
#define CODE_FOR_loongson_psubb CODE_FOR_subv8qi3
#define CODE_FOR_loongson_psubsh CODE_FOR_sssubv4hi3
#define CODE_FOR_loongson_psubsb CODE_FOR_sssubv8qi3
#define CODE_FOR_loongson_psubush CODE_FOR_ussubv4hi3
#define CODE_FOR_loongson_psubusb CODE_FOR_ussubv8qi3
#define CODE_FOR_loongson_punpckhbh CODE_FOR_vec_interleave_highv8qi
#define CODE_FOR_loongson_punpckhhw CODE_FOR_vec_interleave_highv4hi
#define CODE_FOR_loongson_punpckhwd CODE_FOR_vec_interleave_highv2si
#define CODE_FOR_loongson_punpcklbh CODE_FOR_vec_interleave_lowv8qi
#define CODE_FOR_loongson_punpcklhw CODE_FOR_vec_interleave_lowv4hi
#define CODE_FOR_loongson_punpcklwd CODE_FOR_vec_interleave_lowv2si
static const struct mips_builtin_description mips_builtins[] = {
DIRECT_BUILTIN (pll_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
DIRECT_BUILTIN (pul_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
DIRECT_BUILTIN (plu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
DIRECT_BUILTIN (puu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
DIRECT_BUILTIN (cvt_ps_s, MIPS_V2SF_FTYPE_SF_SF, paired_single),
DIRECT_BUILTIN (cvt_s_pl, MIPS_SF_FTYPE_V2SF, paired_single),
DIRECT_BUILTIN (cvt_s_pu, MIPS_SF_FTYPE_V2SF, paired_single),
DIRECT_BUILTIN (abs_ps, MIPS_V2SF_FTYPE_V2SF, paired_single),
DIRECT_BUILTIN (alnv_ps, MIPS_V2SF_FTYPE_V2SF_V2SF_INT, paired_single),
DIRECT_BUILTIN (addr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
DIRECT_BUILTIN (mulr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
DIRECT_BUILTIN (cvt_pw_ps, MIPS_V2SF_FTYPE_V2SF, mips3d),
DIRECT_BUILTIN (cvt_ps_pw, MIPS_V2SF_FTYPE_V2SF, mips3d),
DIRECT_BUILTIN (recip1_s, MIPS_SF_FTYPE_SF, mips3d),
DIRECT_BUILTIN (recip1_d, MIPS_DF_FTYPE_DF, mips3d),
DIRECT_BUILTIN (recip1_ps, MIPS_V2SF_FTYPE_V2SF, mips3d),
DIRECT_BUILTIN (recip2_s, MIPS_SF_FTYPE_SF_SF, mips3d),
DIRECT_BUILTIN (recip2_d, MIPS_DF_FTYPE_DF_DF, mips3d),
DIRECT_BUILTIN (recip2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
DIRECT_BUILTIN (rsqrt1_s, MIPS_SF_FTYPE_SF, mips3d),
DIRECT_BUILTIN (rsqrt1_d, MIPS_DF_FTYPE_DF, mips3d),
DIRECT_BUILTIN (rsqrt1_ps, MIPS_V2SF_FTYPE_V2SF, mips3d),
DIRECT_BUILTIN (rsqrt2_s, MIPS_SF_FTYPE_SF_SF, mips3d),
DIRECT_BUILTIN (rsqrt2_d, MIPS_DF_FTYPE_DF_DF, mips3d),
DIRECT_BUILTIN (rsqrt2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
MIPS_FP_CONDITIONS (CMP_BUILTINS),
/* Built-in functions for the SB-1 processor. */
DIRECT_BUILTIN (sqrt_ps, MIPS_V2SF_FTYPE_V2SF, sb1_paired_single),
/* Built-in functions for the DSP ASE (32-bit and 64-bit). */
DIRECT_BUILTIN (addq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (addq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (addq_s_w, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (addu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (addu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (subq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (subq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (subq_s_w, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (subu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (subu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (addsc, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (addwc, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (modsub, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (raddu_w_qb, MIPS_SI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (absq_s_ph, MIPS_V2HI_FTYPE_V2HI, dsp),
DIRECT_BUILTIN (absq_s_w, MIPS_SI_FTYPE_SI, dsp),
DIRECT_BUILTIN (precrq_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (precrq_ph_w, MIPS_V2HI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (precrq_rs_ph_w, MIPS_V2HI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (precrqu_s_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (preceq_w_phl, MIPS_SI_FTYPE_V2HI, dsp),
DIRECT_BUILTIN (preceq_w_phr, MIPS_SI_FTYPE_V2HI, dsp),
DIRECT_BUILTIN (precequ_ph_qbl, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (precequ_ph_qbr, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (precequ_ph_qbla, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (precequ_ph_qbra, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (preceu_ph_qbl, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (preceu_ph_qbr, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (preceu_ph_qbla, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (preceu_ph_qbra, MIPS_V2HI_FTYPE_V4QI, dsp),
DIRECT_BUILTIN (shll_qb, MIPS_V4QI_FTYPE_V4QI_SI, dsp),
DIRECT_BUILTIN (shll_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
DIRECT_BUILTIN (shll_s_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
DIRECT_BUILTIN (shll_s_w, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (shrl_qb, MIPS_V4QI_FTYPE_V4QI_SI, dsp),
DIRECT_BUILTIN (shra_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
DIRECT_BUILTIN (shra_r_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
DIRECT_BUILTIN (shra_r_w, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (muleu_s_ph_qbl, MIPS_V2HI_FTYPE_V4QI_V2HI, dsp),
DIRECT_BUILTIN (muleu_s_ph_qbr, MIPS_V2HI_FTYPE_V4QI_V2HI, dsp),
DIRECT_BUILTIN (mulq_rs_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (muleq_s_w_phl, MIPS_SI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (muleq_s_w_phr, MIPS_SI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (bitrev, MIPS_SI_FTYPE_SI, dsp),
DIRECT_BUILTIN (insv, MIPS_SI_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (repl_qb, MIPS_V4QI_FTYPE_SI, dsp),
DIRECT_BUILTIN (repl_ph, MIPS_V2HI_FTYPE_SI, dsp),
DIRECT_NO_TARGET_BUILTIN (cmpu_eq_qb, MIPS_VOID_FTYPE_V4QI_V4QI, dsp),
DIRECT_NO_TARGET_BUILTIN (cmpu_lt_qb, MIPS_VOID_FTYPE_V4QI_V4QI, dsp),
DIRECT_NO_TARGET_BUILTIN (cmpu_le_qb, MIPS_VOID_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (cmpgu_eq_qb, MIPS_SI_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (cmpgu_lt_qb, MIPS_SI_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (cmpgu_le_qb, MIPS_SI_FTYPE_V4QI_V4QI, dsp),
DIRECT_NO_TARGET_BUILTIN (cmp_eq_ph, MIPS_VOID_FTYPE_V2HI_V2HI, dsp),
DIRECT_NO_TARGET_BUILTIN (cmp_lt_ph, MIPS_VOID_FTYPE_V2HI_V2HI, dsp),
DIRECT_NO_TARGET_BUILTIN (cmp_le_ph, MIPS_VOID_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (pick_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
DIRECT_BUILTIN (pick_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
DIRECT_BUILTIN (packrl_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
DIRECT_NO_TARGET_BUILTIN (wrdsp, MIPS_VOID_FTYPE_SI_SI, dsp),
DIRECT_BUILTIN (rddsp, MIPS_SI_FTYPE_SI, dsp),
DIRECT_BUILTIN (lbux, MIPS_SI_FTYPE_POINTER_SI, dsp),
DIRECT_BUILTIN (lhx, MIPS_SI_FTYPE_POINTER_SI, dsp),
DIRECT_BUILTIN (lwx, MIPS_SI_FTYPE_POINTER_SI, dsp),
BPOSGE_BUILTIN (32, dsp),
/* The following are for the MIPS DSP ASE REV 2 (32-bit and 64-bit). */
DIRECT_BUILTIN (absq_s_qb, MIPS_V4QI_FTYPE_V4QI, dspr2),
DIRECT_BUILTIN (addu_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (addu_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (adduh_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
DIRECT_BUILTIN (adduh_r_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
DIRECT_BUILTIN (append, MIPS_SI_FTYPE_SI_SI_SI, dspr2),
DIRECT_BUILTIN (balign, MIPS_SI_FTYPE_SI_SI_SI, dspr2),
DIRECT_BUILTIN (cmpgdu_eq_qb, MIPS_SI_FTYPE_V4QI_V4QI, dspr2),
DIRECT_BUILTIN (cmpgdu_lt_qb, MIPS_SI_FTYPE_V4QI_V4QI, dspr2),
DIRECT_BUILTIN (cmpgdu_le_qb, MIPS_SI_FTYPE_V4QI_V4QI, dspr2),
DIRECT_BUILTIN (mul_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (mul_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (mulq_rs_w, MIPS_SI_FTYPE_SI_SI, dspr2),
DIRECT_BUILTIN (mulq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (mulq_s_w, MIPS_SI_FTYPE_SI_SI, dspr2),
DIRECT_BUILTIN (precr_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (precr_sra_ph_w, MIPS_V2HI_FTYPE_SI_SI_SI, dspr2),
DIRECT_BUILTIN (precr_sra_r_ph_w, MIPS_V2HI_FTYPE_SI_SI_SI, dspr2),
DIRECT_BUILTIN (prepend, MIPS_SI_FTYPE_SI_SI_SI, dspr2),
DIRECT_BUILTIN (shra_qb, MIPS_V4QI_FTYPE_V4QI_SI, dspr2),
DIRECT_BUILTIN (shra_r_qb, MIPS_V4QI_FTYPE_V4QI_SI, dspr2),
DIRECT_BUILTIN (shrl_ph, MIPS_V2HI_FTYPE_V2HI_SI, dspr2),
DIRECT_BUILTIN (subu_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (subu_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (subuh_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
DIRECT_BUILTIN (subuh_r_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
DIRECT_BUILTIN (addqh_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (addqh_r_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (addqh_w, MIPS_SI_FTYPE_SI_SI, dspr2),
DIRECT_BUILTIN (addqh_r_w, MIPS_SI_FTYPE_SI_SI, dspr2),
DIRECT_BUILTIN (subqh_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (subqh_r_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
DIRECT_BUILTIN (subqh_w, MIPS_SI_FTYPE_SI_SI, dspr2),
DIRECT_BUILTIN (subqh_r_w, MIPS_SI_FTYPE_SI_SI, dspr2),
/* Built-in functions for the DSP ASE (32-bit only). */
DIRECT_BUILTIN (dpau_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
DIRECT_BUILTIN (dpau_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
DIRECT_BUILTIN (dpsu_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
DIRECT_BUILTIN (dpsu_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
DIRECT_BUILTIN (dpaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
DIRECT_BUILTIN (dpsq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
DIRECT_BUILTIN (mulsaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
DIRECT_BUILTIN (dpaq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, dsp_32),
DIRECT_BUILTIN (dpsq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, dsp_32),
DIRECT_BUILTIN (maq_s_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
DIRECT_BUILTIN (maq_s_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
DIRECT_BUILTIN (maq_sa_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
DIRECT_BUILTIN (maq_sa_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
DIRECT_BUILTIN (extr_w, MIPS_SI_FTYPE_DI_SI, dsp_32),
DIRECT_BUILTIN (extr_r_w, MIPS_SI_FTYPE_DI_SI, dsp_32),
DIRECT_BUILTIN (extr_rs_w, MIPS_SI_FTYPE_DI_SI, dsp_32),
DIRECT_BUILTIN (extr_s_h, MIPS_SI_FTYPE_DI_SI, dsp_32),
DIRECT_BUILTIN (extp, MIPS_SI_FTYPE_DI_SI, dsp_32),
DIRECT_BUILTIN (extpdp, MIPS_SI_FTYPE_DI_SI, dsp_32),
DIRECT_BUILTIN (shilo, MIPS_DI_FTYPE_DI_SI, dsp_32),
DIRECT_BUILTIN (mthlip, MIPS_DI_FTYPE_DI_SI, dsp_32),
/* The following are for the MIPS DSP ASE REV 2 (32-bit only). */
DIRECT_BUILTIN (dpa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
DIRECT_BUILTIN (dps_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
DIRECT_BUILTIN (madd, MIPS_DI_FTYPE_DI_SI_SI, dspr2_32),
DIRECT_BUILTIN (maddu, MIPS_DI_FTYPE_DI_USI_USI, dspr2_32),
DIRECT_BUILTIN (msub, MIPS_DI_FTYPE_DI_SI_SI, dspr2_32),
DIRECT_BUILTIN (msubu, MIPS_DI_FTYPE_DI_USI_USI, dspr2_32),
DIRECT_BUILTIN (mulsa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
DIRECT_BUILTIN (mult, MIPS_DI_FTYPE_SI_SI, dspr2_32),
DIRECT_BUILTIN (multu, MIPS_DI_FTYPE_USI_USI, dspr2_32),
DIRECT_BUILTIN (dpax_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
DIRECT_BUILTIN (dpsx_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
DIRECT_BUILTIN (dpaqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
DIRECT_BUILTIN (dpaqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
DIRECT_BUILTIN (dpsqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
DIRECT_BUILTIN (dpsqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
/* Builtin functions for ST Microelectronics Loongson-2E/2F cores. */
LOONGSON_BUILTIN (packsswh, MIPS_V4HI_FTYPE_V2SI_V2SI),
LOONGSON_BUILTIN (packsshb, MIPS_V8QI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (packushb, MIPS_UV8QI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (paddw, u, MIPS_UV2SI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN_SUFFIX (paddh, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (paddb, u, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (paddw, s, MIPS_V2SI_FTYPE_V2SI_V2SI),
LOONGSON_BUILTIN_SUFFIX (paddh, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (paddb, s, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN_SUFFIX (paddd, u, MIPS_UDI_FTYPE_UDI_UDI),
LOONGSON_BUILTIN_SUFFIX (paddd, s, MIPS_DI_FTYPE_DI_DI),
LOONGSON_BUILTIN (paddsh, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (paddsb, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN (paddush, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN (paddusb, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_ALIAS (pandn_d, pandn_ud, MIPS_UDI_FTYPE_UDI_UDI),
LOONGSON_BUILTIN_ALIAS (pandn_w, pandn_uw, MIPS_UV2SI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN_ALIAS (pandn_h, pandn_uh, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_ALIAS (pandn_b, pandn_ub, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_ALIAS (pandn_d, pandn_sd, MIPS_DI_FTYPE_DI_DI),
LOONGSON_BUILTIN_ALIAS (pandn_w, pandn_sw, MIPS_V2SI_FTYPE_V2SI_V2SI),
LOONGSON_BUILTIN_ALIAS (pandn_h, pandn_sh, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_ALIAS (pandn_b, pandn_sb, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN (pavgh, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN (pavgb, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (pcmpeqw, u, MIPS_UV2SI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN_SUFFIX (pcmpeqh, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (pcmpeqb, u, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (pcmpeqw, s, MIPS_V2SI_FTYPE_V2SI_V2SI),
LOONGSON_BUILTIN_SUFFIX (pcmpeqh, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (pcmpeqb, s, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN_SUFFIX (pcmpgtw, u, MIPS_UV2SI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN_SUFFIX (pcmpgth, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (pcmpgtb, u, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (pcmpgtw, s, MIPS_V2SI_FTYPE_V2SI_V2SI),
LOONGSON_BUILTIN_SUFFIX (pcmpgth, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (pcmpgtb, s, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN_SUFFIX (pextrh, u, MIPS_UV4HI_FTYPE_UV4HI_USI),
LOONGSON_BUILTIN_SUFFIX (pextrh, s, MIPS_V4HI_FTYPE_V4HI_USI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_0, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_1, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_2, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_3, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_0, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_1, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_2, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (pinsrh_3, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (pmaddhw, MIPS_V2SI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (pmaxsh, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (pmaxub, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN (pminsh, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (pminub, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (pmovmskb, u, MIPS_UV8QI_FTYPE_UV8QI),
LOONGSON_BUILTIN_SUFFIX (pmovmskb, s, MIPS_V8QI_FTYPE_V8QI),
LOONGSON_BUILTIN (pmulhuh, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN (pmulhh, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (pmullh, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (pmuluw, MIPS_UDI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN (pasubub, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN (biadd, MIPS_UV4HI_FTYPE_UV8QI),
LOONGSON_BUILTIN (psadbh, MIPS_UV4HI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (pshufh, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (pshufh, s, MIPS_V4HI_FTYPE_V4HI_V4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (psllh, u, MIPS_UV4HI_FTYPE_UV4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (psllh, s, MIPS_V4HI_FTYPE_V4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (psllw, u, MIPS_UV2SI_FTYPE_UV2SI_UQI),
LOONGSON_BUILTIN_SUFFIX (psllw, s, MIPS_V2SI_FTYPE_V2SI_UQI),
LOONGSON_BUILTIN_SUFFIX (psrah, u, MIPS_UV4HI_FTYPE_UV4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (psrah, s, MIPS_V4HI_FTYPE_V4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (psraw, u, MIPS_UV2SI_FTYPE_UV2SI_UQI),
LOONGSON_BUILTIN_SUFFIX (psraw, s, MIPS_V2SI_FTYPE_V2SI_UQI),
LOONGSON_BUILTIN_SUFFIX (psrlh, u, MIPS_UV4HI_FTYPE_UV4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (psrlh, s, MIPS_V4HI_FTYPE_V4HI_UQI),
LOONGSON_BUILTIN_SUFFIX (psrlw, u, MIPS_UV2SI_FTYPE_UV2SI_UQI),
LOONGSON_BUILTIN_SUFFIX (psrlw, s, MIPS_V2SI_FTYPE_V2SI_UQI),
LOONGSON_BUILTIN_SUFFIX (psubw, u, MIPS_UV2SI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN_SUFFIX (psubh, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (psubb, u, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (psubw, s, MIPS_V2SI_FTYPE_V2SI_V2SI),
LOONGSON_BUILTIN_SUFFIX (psubh, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (psubb, s, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN_SUFFIX (psubd, u, MIPS_UDI_FTYPE_UDI_UDI),
LOONGSON_BUILTIN_SUFFIX (psubd, s, MIPS_DI_FTYPE_DI_DI),
LOONGSON_BUILTIN (psubsh, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN (psubsb, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN (psubush, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN (psubusb, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (punpckhbh, u, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (punpckhhw, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (punpckhwd, u, MIPS_UV2SI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN_SUFFIX (punpckhbh, s, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN_SUFFIX (punpckhhw, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (punpckhwd, s, MIPS_V2SI_FTYPE_V2SI_V2SI),
LOONGSON_BUILTIN_SUFFIX (punpcklbh, u, MIPS_UV8QI_FTYPE_UV8QI_UV8QI),
LOONGSON_BUILTIN_SUFFIX (punpcklhw, u, MIPS_UV4HI_FTYPE_UV4HI_UV4HI),
LOONGSON_BUILTIN_SUFFIX (punpcklwd, u, MIPS_UV2SI_FTYPE_UV2SI_UV2SI),
LOONGSON_BUILTIN_SUFFIX (punpcklbh, s, MIPS_V8QI_FTYPE_V8QI_V8QI),
LOONGSON_BUILTIN_SUFFIX (punpcklhw, s, MIPS_V4HI_FTYPE_V4HI_V4HI),
LOONGSON_BUILTIN_SUFFIX (punpcklwd, s, MIPS_V2SI_FTYPE_V2SI_V2SI)
};
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* MODE is a vector mode whose elements have type TYPE. Return the type
of the vector itself. */
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
static tree
mips_builtin_vector_type (tree type, enum machine_mode mode)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
{
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
static tree types[2 * (int) MAX_MACHINE_MODE];
int mode_index;
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
mode_index = (int) mode;
if (TREE_CODE (type) == INTEGER_TYPE && TYPE_UNSIGNED (type))
mode_index += MAX_MACHINE_MODE;
if (types[mode_index] == NULL_TREE)
types[mode_index] = build_vector_type_for_mode (type, mode);
return types[mode_index];
}
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* Source-level argument types. */
#define MIPS_ATYPE_VOID void_type_node
#define MIPS_ATYPE_INT integer_type_node
#define MIPS_ATYPE_POINTER ptr_type_node
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* Standard mode-based argument types. */
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
#define MIPS_ATYPE_UQI unsigned_intQI_type_node
#define MIPS_ATYPE_SI intSI_type_node
#define MIPS_ATYPE_USI unsigned_intSI_type_node
#define MIPS_ATYPE_DI intDI_type_node
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
#define MIPS_ATYPE_UDI unsigned_intDI_type_node
#define MIPS_ATYPE_SF float_type_node
#define MIPS_ATYPE_DF double_type_node
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* Vector argument types. */
#define MIPS_ATYPE_V2SF mips_builtin_vector_type (float_type_node, V2SFmode)
#define MIPS_ATYPE_V2HI mips_builtin_vector_type (intHI_type_node, V2HImode)
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
#define MIPS_ATYPE_V2SI mips_builtin_vector_type (intSI_type_node, V2SImode)
#define MIPS_ATYPE_V4QI mips_builtin_vector_type (intQI_type_node, V4QImode)
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
#define MIPS_ATYPE_V4HI mips_builtin_vector_type (intHI_type_node, V4HImode)
#define MIPS_ATYPE_V8QI mips_builtin_vector_type (intQI_type_node, V8QImode)
#define MIPS_ATYPE_UV2SI \
mips_builtin_vector_type (unsigned_intSI_type_node, V2SImode)
#define MIPS_ATYPE_UV4HI \
mips_builtin_vector_type (unsigned_intHI_type_node, V4HImode)
#define MIPS_ATYPE_UV8QI \
mips_builtin_vector_type (unsigned_intQI_type_node, V8QImode)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* MIPS_FTYPE_ATYPESN takes N MIPS_FTYPES-like type codes and lists
their associated MIPS_ATYPEs. */
#define MIPS_FTYPE_ATYPES1(A, B) \
MIPS_ATYPE_##A, MIPS_ATYPE_##B
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
#define MIPS_FTYPE_ATYPES2(A, B, C) \
MIPS_ATYPE_##A, MIPS_ATYPE_##B, MIPS_ATYPE_##C
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
#define MIPS_FTYPE_ATYPES3(A, B, C, D) \
MIPS_ATYPE_##A, MIPS_ATYPE_##B, MIPS_ATYPE_##C, MIPS_ATYPE_##D
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
#define MIPS_FTYPE_ATYPES4(A, B, C, D, E) \
MIPS_ATYPE_##A, MIPS_ATYPE_##B, MIPS_ATYPE_##C, MIPS_ATYPE_##D, \
MIPS_ATYPE_##E
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* Return the function type associated with function prototype TYPE. */
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
static tree
mips_build_function_type (enum mips_function_type type)
{
static tree types[(int) MIPS_MAX_FTYPE_MAX];
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
if (types[(int) type] == NULL_TREE)
switch (type)
{
#define DEF_MIPS_FTYPE(NUM, ARGS) \
case MIPS_FTYPE_NAME##NUM ARGS: \
types[(int) type] \
= build_function_type_list (MIPS_FTYPE_ATYPES##NUM ARGS, \
NULL_TREE); \
break;
#include "config/mips/mips-ftypes.def"
#undef DEF_MIPS_FTYPE
default:
gcc_unreachable ();
}
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
return types[(int) type];
}
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_INIT_BUILTINS. */
static void
mips_init_builtins (void)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
const struct mips_builtin_description *d;
unsigned int i;
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
/* Iterate through all of the bdesc arrays, initializing all of the
builtin functions. */
for (i = 0; i < ARRAY_SIZE (mips_builtins); i++)
{
d = &mips_builtins[i];
if (d->avail ())
add_builtin_function (d->name,
mips_build_function_type (d->function_type),
i, BUILT_IN_MD, NULL, NULL);
}
}
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Take argument ARGNO from EXP's argument list and convert it into a
form suitable for input operand OPNO of instruction ICODE. Return the
value. */
static rtx
mips_prepare_builtin_arg (enum insn_code icode,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned int opno, tree exp, unsigned int argno)
{
rtx value;
enum machine_mode mode;
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
value = expand_normal (CALL_EXPR_ARG (exp, argno));
mode = insn_data[icode].operand[opno].mode;
if (!insn_data[icode].operand[opno].predicate (value, mode))
{
value = copy_to_mode_reg (mode, value);
/* Check the predicate again. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (!insn_data[icode].operand[opno].predicate (value, mode))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
error ("invalid argument to built-in function");
return const0_rtx;
}
}
return value;
}
/* Return an rtx suitable for output operand OP of instruction ICODE.
If TARGET is non-null, try to use it where possible. */
static rtx
mips_prepare_builtin_target (enum insn_code icode, unsigned int op, rtx target)
{
enum machine_mode mode;
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
mode = insn_data[icode].operand[op].mode;
if (target == 0 || !insn_data[icode].operand[op].predicate (target, mode))
target = gen_reg_rtx (mode);
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
return target;
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Expand a MIPS_BUILTIN_DIRECT or MIPS_BUILTIN_DIRECT_NO_TARGET function;
HAS_TARGET_P says which. EXP is the CALL_EXPR that calls the function
and ICODE is the code of the associated .md pattern. TARGET, if nonnull,
suggests a good place to put the result. */
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
static rtx
mips_expand_builtin_direct (enum insn_code icode, rtx target, tree exp,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
bool has_target_p)
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
{
rtx ops[MAX_RECOG_OPERANDS];
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
int opno, argno;
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Map any target to operand 0. */
opno = 0;
if (has_target_p)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
ops[opno] = mips_prepare_builtin_target (icode, opno, target);
opno++;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Map the arguments to the other operands. The n_operands value
for an expander includes match_dups and match_scratches as well as
match_operands, so n_operands is only an upper bound on the number
of arguments to the expander function. */
gcc_assert (opno + call_expr_nargs (exp) <= insn_data[icode].n_operands);
for (argno = 0; argno < call_expr_nargs (exp); argno++, opno++)
ops[opno] = mips_prepare_builtin_arg (icode, opno, exp, argno);
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
switch (opno)
{
case 2:
emit_insn (GEN_FCN (icode) (ops[0], ops[1]));
break;
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
case 3:
emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2]));
break;
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
case 4:
emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2], ops[3]));
break;
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
default:
gcc_unreachable ();
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
}
return target;
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
}
mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. * config/mips/mips.c (machine_function): Add new fields: ignore_hazard_length_p and all_noreorder_p. (mips_flag_delayed_branch): New variable. (override_options): Treat '/' as an operand punctuation character. Set up mips_flag_delayed_branch. (print_operand): Handle '/'. (mips_output_function_prologue): Put the whole function in .set noreorder and .set nomacro if all_noreorder_p is true. (mips_output_function_epilogue): End the noreorder/nomacro sequence. (mips16_optimize_gp): Remove "first insn" parameter. (mips16_lay_out_constants): New function, split out from mips_reorg. (mips_avoid_hazard, mips_avoid_hazards): New functions. (mips_reorg): For mips16 code, call mips16_lay_out_constant and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, do delayed-branch scheduling followed by hazard detection. (mips_adjust_insn_length): Only account for hazards if !ignore_hazard_length_p. (mips_output_load_label): Add a nop to the o32 sequence if the target suffers from load delays. (mips_output_conditional_branch): Add %/ to the end of branches. (mips_output_division): Fill the branch delay slot with %#. * config/mips/mips.md: Remove redundant '%*' from mips16 branch instructions. End all other %* branches with %/. (ffssi2, ffsdi2): Fix lengths. (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. (fix_truncsfsi2_macro): Likewise. (mov_lwl): Set hazard to "none". (ashldi3_internal): Fill the branch delay slot with %#. (ashrdi3_internal, lshrdi3_internal): Likewise. (exception_receiver): Explicitly set $28. (hazard_nop): New pattern. From-SVN: r68821
2003-07-02 09:34:27 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Expand a __builtin_mips_movt_*_ps or __builtin_mips_movf_*_ps
function; TYPE says which. EXP is the CALL_EXPR that calls the
function, ICODE is the instruction that should be used to compare
the first two arguments, and COND is the condition it should test.
TARGET, if nonnull, suggests a good place to put the result. */
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
static rtx
mips_expand_builtin_movtf (enum mips_builtin_type type,
enum insn_code icode, enum mips_fp_condition cond,
rtx target, tree exp)
{
rtx cmp_result, op0, op1;
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
cmp_result = mips_prepare_builtin_target (icode, 0, 0);
op0 = mips_prepare_builtin_arg (icode, 1, exp, 0);
op1 = mips_prepare_builtin_arg (icode, 2, exp, 1);
emit_insn (GEN_FCN (icode) (cmp_result, op0, op1, GEN_INT (cond)));
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
icode = CODE_FOR_mips_cond_move_tf_ps;
target = mips_prepare_builtin_target (icode, 0, target);
if (type == MIPS_BUILTIN_MOVT)
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
{
op1 = mips_prepare_builtin_arg (icode, 2, exp, 2);
op0 = mips_prepare_builtin_arg (icode, 1, exp, 3);
}
else
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
{
op0 = mips_prepare_builtin_arg (icode, 1, exp, 2);
op1 = mips_prepare_builtin_arg (icode, 2, exp, 3);
}
emit_insn (gen_mips_cond_move_tf_ps (target, op0, op1, cmp_result));
return target;
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
}
/* Move VALUE_IF_TRUE into TARGET if CONDITION is true; move VALUE_IF_FALSE
into TARGET otherwise. Return TARGET. */
static rtx
mips_builtin_branch_and_move (rtx condition, rtx target,
rtx value_if_true, rtx value_if_false)
{
rtx true_label, done_label;
true_label = gen_label_rtx ();
done_label = gen_label_rtx ();
/* First assume that CONDITION is false. */
mips_emit_move (target, value_if_false);
/* Branch to TRUE_LABEL if CONDITION is true and DONE_LABEL otherwise. */
emit_jump_insn (gen_condjump (condition, true_label));
emit_jump_insn (gen_jump (done_label));
emit_barrier ();
/* Fix TARGET if CONDITION is true. */
emit_label (true_label);
mips_emit_move (target, value_if_true);
emit_label (done_label);
return target;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Expand a comparison built-in function of type BUILTIN_TYPE. EXP is
the CALL_EXPR that calls the function, ICODE is the code of the
comparison instruction, and COND is the condition it should test.
TARGET, if nonnull, suggests a good place to put the boolean result. */
static rtx
mips_expand_builtin_compare (enum mips_builtin_type builtin_type,
enum insn_code icode, enum mips_fp_condition cond,
rtx target, tree exp)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
rtx offset, condition, cmp_result, args[MAX_RECOG_OPERANDS];
int argno;
if (target == 0 || GET_MODE (target) != SImode)
target = gen_reg_rtx (SImode);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The instruction should have a target operand, an operand for each
argument, and an operand for COND. */
gcc_assert (call_expr_nargs (exp) + 2 == insn_data[icode].n_operands);
/* Prepare the operands to the comparison. */
cmp_result = mips_prepare_builtin_target (icode, 0, 0);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
for (argno = 0; argno < call_expr_nargs (exp); argno++)
args[argno] = mips_prepare_builtin_arg (icode, argno + 1, exp, argno);
switch (insn_data[icode].n_operands)
{
case 4:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
emit_insn (GEN_FCN (icode) (cmp_result, args[0], args[1],
GEN_INT (cond)));
break;
case 6:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
emit_insn (GEN_FCN (icode) (cmp_result, args[0], args[1],
args[2], args[3], GEN_INT (cond)));
break;
default:
gcc_unreachable ();
}
/* If the comparison sets more than one register, we define the result
to be 0 if all registers are false and -1 if all registers are true.
The value of the complete result is indeterminate otherwise. */
switch (builtin_type)
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
{
case MIPS_BUILTIN_CMP_ALL:
condition = gen_rtx_NE (VOIDmode, cmp_result, constm1_rtx);
return mips_builtin_branch_and_move (condition, target,
const0_rtx, const1_rtx);
case MIPS_BUILTIN_CMP_UPPER:
case MIPS_BUILTIN_CMP_LOWER:
offset = GEN_INT (builtin_type == MIPS_BUILTIN_CMP_UPPER);
condition = gen_single_cc (cmp_result, offset);
return mips_builtin_branch_and_move (condition, target,
const1_rtx, const0_rtx);
default:
condition = gen_rtx_NE (VOIDmode, cmp_result, const0_rtx);
return mips_builtin_branch_and_move (condition, target,
const1_rtx, const0_rtx);
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Expand a bposge built-in function of type BUILTIN_TYPE. TARGET,
if nonnull, suggests a good place to put the boolean result. */
static rtx
mips_expand_builtin_bposge (enum mips_builtin_type builtin_type, rtx target)
{
rtx condition, cmp_result;
int cmp_value;
if (target == 0 || GET_MODE (target) != SImode)
target = gen_reg_rtx (SImode);
cmp_result = gen_rtx_REG (CCDSPmode, CCDSP_PO_REGNUM);
if (builtin_type == MIPS_BUILTIN_BPOSGE32)
cmp_value = 32;
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
else
gcc_assert (0);
condition = gen_rtx_GE (VOIDmode, cmp_result, GEN_INT (cmp_value));
return mips_builtin_branch_and_move (condition, target,
const1_rtx, const0_rtx);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement TARGET_EXPAND_BUILTIN. */
static rtx
mips_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED,
int ignore ATTRIBUTE_UNUSED)
{
tree fndecl;
unsigned int fcode, avail;
const struct mips_builtin_description *d;
fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
fcode = DECL_FUNCTION_CODE (fndecl);
gcc_assert (fcode < ARRAY_SIZE (mips_builtins));
d = &mips_builtins[fcode];
avail = d->avail ();
gcc_assert (avail != 0);
if (TARGET_MIPS16)
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
{
error ("built-in function %qs not supported for MIPS16",
IDENTIFIER_POINTER (DECL_NAME (fndecl)));
return const0_rtx;
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
}
switch (d->builtin_type)
{
case MIPS_BUILTIN_DIRECT:
return mips_expand_builtin_direct (d->icode, target, exp, true);
case MIPS_BUILTIN_DIRECT_NO_TARGET:
return mips_expand_builtin_direct (d->icode, target, exp, false);
case MIPS_BUILTIN_MOVT:
case MIPS_BUILTIN_MOVF:
return mips_expand_builtin_movtf (d->builtin_type, d->icode,
d->cond, target, exp);
case MIPS_BUILTIN_CMP_ANY:
case MIPS_BUILTIN_CMP_ALL:
case MIPS_BUILTIN_CMP_UPPER:
case MIPS_BUILTIN_CMP_LOWER:
case MIPS_BUILTIN_CMP_SINGLE:
return mips_expand_builtin_compare (d->builtin_type, d->icode,
d->cond, target, exp);
case MIPS_BUILTIN_BPOSGE32:
return mips_expand_builtin_bposge (d->builtin_type, target);
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
}
gcc_unreachable ();
}
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* An entry in the MIPS16 constant pool. VALUE is the pool constant,
MODE is its mode, and LABEL is the CODE_LABEL associated with it. */
struct mips16_constant {
struct mips16_constant *next;
rtx value;
rtx label;
enum machine_mode mode;
};
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Information about an incomplete MIPS16 constant pool. FIRST is the
first constant, HIGHEST_ADDRESS is the highest address that the first
byte of the pool can have, and INSN_ADDRESS is the current instruction
address. */
struct mips16_constant_pool {
struct mips16_constant *first;
int highest_address;
int insn_address;
};
/* Add constant VALUE to POOL and return its label. MODE is the
value's mode (used for CONST_INTs, etc.). */
static rtx
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_add_constant (struct mips16_constant_pool *pool,
rtx value, enum machine_mode mode)
{
struct mips16_constant **p, *c;
bool first_of_size_p;
/* See whether the constant is already in the pool. If so, return the
existing label, otherwise leave P pointing to the place where the
constant should be added.
Keep the pool sorted in increasing order of mode size so that we can
reduce the number of alignments needed. */
first_of_size_p = true;
for (p = &pool->first; *p != 0; p = &(*p)->next)
{
if (mode == (*p)->mode && rtx_equal_p (value, (*p)->value))
return (*p)->label;
if (GET_MODE_SIZE (mode) < GET_MODE_SIZE ((*p)->mode))
break;
if (GET_MODE_SIZE (mode) == GET_MODE_SIZE ((*p)->mode))
first_of_size_p = false;
}
/* In the worst case, the constant needed by the earliest instruction
will end up at the end of the pool. The entire pool must then be
accessible from that instruction.
When adding the first constant, set the pool's highest address to
the address of the first out-of-range byte. Adjust this address
downwards each time a new constant is added. */
if (pool->first == 0)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* For LWPC, ADDIUPC and DADDIUPC, the base PC value is the address
of the instruction with the lowest two bits clear. The base PC
value for LDPC has the lowest three bits clear. Assume the worst
case here; namely that the PC-relative instruction occupies the
last 2 bytes in an aligned word. */
pool->highest_address = pool->insn_address - (UNITS_PER_WORD - 2) + 0x8000;
pool->highest_address -= GET_MODE_SIZE (mode);
if (first_of_size_p)
/* Take into account the worst possible padding due to alignment. */
pool->highest_address -= GET_MODE_SIZE (mode) - 1;
/* Create a new entry. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
c = XNEW (struct mips16_constant);
c->value = value;
c->mode = mode;
c->label = gen_label_rtx ();
c->next = *p;
*p = c;
return c->label;
}
/* Output constant VALUE after instruction INSN and return the last
instruction emitted. MODE is the mode of the constant. */
static rtx
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_emit_constants_1 (enum machine_mode mode, rtx value, rtx insn)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (SCALAR_INT_MODE_P (mode) || ALL_SCALAR_FIXED_POINT_MODE_P (mode))
{
rtx size = GEN_INT (GET_MODE_SIZE (mode));
return emit_insn_after (gen_consttable_int (value, size), insn);
}
if (SCALAR_FLOAT_MODE_P (mode))
return emit_insn_after (gen_consttable_float (value), insn);
if (VECTOR_MODE_P (mode))
{
int i;
for (i = 0; i < CONST_VECTOR_NUNITS (value); i++)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
insn = mips16_emit_constants_1 (GET_MODE_INNER (mode),
CONST_VECTOR_ELT (value, i), insn);
return insn;
}
gcc_unreachable ();
}
/* Dump out the constants in CONSTANTS after INSN. */
static void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_emit_constants (struct mips16_constant *constants, rtx insn)
{
struct mips16_constant *c, *next;
int align;
align = 0;
for (c = constants; c != NULL; c = next)
{
/* If necessary, increase the alignment of PC. */
if (align < GET_MODE_SIZE (c->mode))
{
int align_log = floor_log2 (GET_MODE_SIZE (c->mode));
insn = emit_insn_after (gen_align (GEN_INT (align_log)), insn);
}
align = GET_MODE_SIZE (c->mode);
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
insn = emit_label_after (c->label, insn);
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
insn = mips16_emit_constants_1 (c->mode, c->value, insn);
next = c->next;
free (c);
}
emit_barrier_after (insn);
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
}
/* Return the length of instruction INSN. */
static int
mips16_insn_length (rtx insn)
{
if (JUMP_P (insn))
{
rtx body = PATTERN (insn);
if (GET_CODE (body) == ADDR_VEC)
return GET_MODE_SIZE (GET_MODE (body)) * XVECLEN (body, 0);
if (GET_CODE (body) == ADDR_DIFF_VEC)
return GET_MODE_SIZE (GET_MODE (body)) * XVECLEN (body, 1);
}
return get_attr_length (insn);
}
/* If *X is a symbolic constant that refers to the constant pool, add
the constant to POOL and rewrite *X to use the constant's label. */
static void
mips16_rewrite_pool_constant (struct mips16_constant_pool *pool, rtx *x)
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
{
rtx base, offset, label;
split_const (*x, &base, &offset);
if (GET_CODE (base) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (base))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
label = mips16_add_constant (pool, get_pool_constant (base),
get_pool_mode (base));
base = gen_rtx_LABEL_REF (Pmode, label);
*x = mips_unspec_address_offset (base, offset, SYMBOL_PC_RELATIVE);
}
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
}
/* This structure is used to communicate with mips16_rewrite_pool_refs.
INSN is the instruction we're rewriting and POOL points to the current
constant pool. */
struct mips16_rewrite_pool_refs_info {
rtx insn;
struct mips16_constant_pool *pool;
};
/* Rewrite *X so that constant pool references refer to the constant's
label instead. DATA points to a mips16_rewrite_pool_refs_info
structure. */
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
static int
mips16_rewrite_pool_refs (rtx *x, void *data)
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
{
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
struct mips16_rewrite_pool_refs_info *info =
(struct mips16_rewrite_pool_refs_info *) data;
if (force_to_mem_operand (*x, Pmode))
{
rtx mem = force_const_mem (GET_MODE (*x), *x);
validate_change (info->insn, x, mem, false);
}
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
if (MEM_P (*x))
{
mips16_rewrite_pool_constant (info->pool, &XEXP (*x, 0));
return -1;
}
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
if (TARGET_MIPS16_TEXT_LOADS)
mips16_rewrite_pool_constant (info->pool, x);
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
return GET_CODE (*x) == CONST ? -1 : 0;
}
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
/* Build MIPS16 constant pools. */
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
static void
mips16_lay_out_constants (void)
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
{
struct mips16_constant_pool pool;
struct mips16_rewrite_pool_refs_info info;
rtx insn, barrier;
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
if (!TARGET_MIPS16_PCREL_LOADS)
return;
invoke.texi: Document -mabi=meabi, and expand on the EABI description. * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI description. Document -mips32, -mips64, and the associated -march values. Describe the "mipsN" arguments to -march. Say that the -mipsN options are equivalent to -march. Reword the description of default type sizes. * toplev.h (target_flags_explicit): Declare. * toplev.c (target_flags_explicit): New var. (set_target_switch): Update target_flags_explicit. * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. * config/mips/mips.h (mips_cpu_info): New struct. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. (MIPS_CPP_SET_PROCESSOR): New macro. (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. Define _MIPS_ARCH and _MIPS_TUNE. (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor MIPS_ISA_DEFAULT were already defined. (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. (ABI_GAS_ASM_SPEC): Remove. (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. Invoke %(asm_abi_default_spec) if no ABI was specified. (CC1_SPEC): Remove ISA -> register-size rules. (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. (mips_cpu_string, mips_explicit_type_size_string): Remove. (mips_cpu_info_table): New array. (mips_set_architecture, mips_set_tune): New fns. (override_options): Rework to make -mipsN equivalent to -march. Detect more erroneous cases, including those removed from CC1_SPEC. Don't change the ABI based on architecture, or vice versa. Unify logic with GAS. (mips_asm_file_start): Get architecture name from mips_arch_info. (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. (mips_parse_cpu): Take the name of the option as argument. Handle 'from-abi'. Raise an error if the option is wrong. (mips_cpu_info_from_isa): New fn. [gcc/testsuite] * gcc.dg/mips-args-[123].c: New tests. From-SVN: r55747
2002-07-25 12:16:00 +02:00
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
split_all_insns_noflow ();
barrier = 0;
memset (&pool, 0, sizeof (pool));
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
/* Rewrite constant pool references in INSN. */
if (INSN_P (insn))
{
info.insn = insn;
info.pool = &pool;
for_each_rtx (&PATTERN (insn), mips16_rewrite_pool_refs, &info);
}
pool.insn_address += mips16_insn_length (insn);
mips.md: Add unspec #2. 2001-09-15 Eric Christopher <echristo@redhat.com> * config/mips/mips.md: Add unspec #2. (reload_indi): Use. (reload_outdi): Ditto. (reload_outsi): Ditto. (HILO_delay): New. 2001-09-15 Eric Christopher <echristo@redhat.com> Jason Eckhardt <jle@redhat.com> * config.gcc: Add mipsisa32 target and mipsisa32-linux target. * config/mips/isa32-linux.h: New file. * config/mips/isa3264.h: Ditto. * config/mips/mips-protos.h: Add mips_hard_regno_nregs. * config/mips/mips.c (mips_hard_regno_nregs): Move here from mips.h. (output_block_mode): Support MEABI. (function_arg): Ditto. Fix floating point arg passing. (mips_va_start): Ditto. (override_options): Add isas 32 and 64, meabi, mips32 and mips64 processors. (mips_asm_file_start): Add new section to pass abi to gdb. (function_arg_pass_by_reference): Support MEABI. (mips_parse_cpu): Support mips32 and mips64 processors. * config/mips/mips.h: Support ABI_MEABI, TARGET_MIPS4KC, TARGET_MIPS5KC. Support isa32 and isa64. (processor_type): Add r4kc, r5kc, r20kc. (GENERATE_MULT3_SI): New. (GENERATE_MULT3_DI): Ditto. (GENERATE_MULT3): Remove. (ISA_HAS_64BIT_REGS): Add isa == 64. (ISA_HAS_8CC): Add mips_isa = 32 and 64. (ISA_HAS_MADD_MSUB): New. (ISA_HAS_CLZ_CLO): Ditto. (ISA_HAS_DCLZ_DCLO): Ditto. (ABI_GAS_ASM_SPEC): New. (GAS_ASM_SPEC): Use. Add support for mips32, mips64. (ASM_SPEC): Ditto. (LINK_SPEC): Ditto. (SUBTARGET_CC1_SPEC): Ditto. (SUBTARGET_CPP_SIZE_SPEC): Ditto. (PAD_VARARGS_DOWN): Support MEABI. (HARD_REGNO_NREGS): Move to mips.c. (ASM_OUTPUT_IDENT): Add #undef. * config/mips/mips.md: Add r4kc, r5kc, r20kc. (mulsi3): Use GENERATE_MULT3_SI. (mulsi3_mult3): Ditto. Support mips32, mips64. (mul_acc_si): Use ISA_HAS_MADD_MSUB. (mul_sub_si): New pattern. (unnamed splitters): New. (muldi3): Use GENERATE_MULT3_DI. (muldi3_internal2): Ditto. (movdicc): Support mips32. * config/mips/t-isa3264: New file. From-SVN: r45623
2001-09-15 04:03:14 +02:00
if (pool.first != NULL)
{
/* If there are no natural barriers between the first user of
the pool and the highest acceptable address, we'll need to
create a new instruction to jump around the constant pool.
In the worst case, this instruction will be 4 bytes long.
If it's too late to do this transformation after INSN,
do it immediately before INSN. */
if (barrier == 0 && pool.insn_address + 4 > pool.highest_address)
{
rtx label, jump;
label = gen_label_rtx ();
jump = emit_jump_insn_before (gen_jump (label), insn);
JUMP_LABEL (jump) = label;
LABEL_NUSES (label) = 1;
barrier = emit_barrier_after (jump);
emit_label_after (label, barrier);
pool.insn_address += 4;
}
/* See whether the constant pool is now out of range of the first
user. If so, output the constants after the previous barrier.
Note that any instructions between BARRIER and INSN (inclusive)
will use negative offsets to refer to the pool. */
if (pool.insn_address > pool.highest_address)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_emit_constants (pool.first, barrier);
pool.first = NULL;
barrier = 0;
}
else if (BARRIER_P (insn))
barrier = insn;
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips16_emit_constants (pool.first, get_last_insn ());
}
/* A temporary variable used by for_each_rtx callbacks, etc. */
static rtx mips_sim_insn;
/* A structure representing the state of the processor pipeline.
Used by the mips_sim_* family of functions. */
struct mips_sim {
/* The maximum number of instructions that can be issued in a cycle.
(Caches mips_issue_rate.) */
unsigned int issue_rate;
/* The current simulation time. */
unsigned int time;
/* How many more instructions can be issued in the current cycle. */
unsigned int insns_left;
/* LAST_SET[X].INSN is the last instruction to set register X.
LAST_SET[X].TIME is the time at which that instruction was issued.
INSN is null if no instruction has yet set register X. */
struct {
rtx insn;
unsigned int time;
} last_set[FIRST_PSEUDO_REGISTER];
/* The pipeline's current DFA state. */
state_t dfa_state;
};
/* Reset STATE to the initial simulation state. */
static void
mips_sim_reset (struct mips_sim *state)
{
state->time = 0;
state->insns_left = state->issue_rate;
memset (&state->last_set, 0, sizeof (state->last_set));
state_reset (state->dfa_state);
}
/* Initialize STATE before its first use. DFA_STATE points to an
allocated but uninitialized DFA state. */
static void
mips_sim_init (struct mips_sim *state, state_t dfa_state)
{
state->issue_rate = mips_issue_rate ();
state->dfa_state = dfa_state;
mips_sim_reset (state);
}
/* Advance STATE by one clock cycle. */
static void
mips_sim_next_cycle (struct mips_sim *state)
{
state->time++;
state->insns_left = state->issue_rate;
state_transition (state->dfa_state, 0);
}
/* Advance simulation state STATE until instruction INSN can read
register REG. */
static void
mips_sim_wait_reg (struct mips_sim *state, rtx insn, rtx reg)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned int regno, end_regno;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
end_regno = END_REGNO (reg);
for (regno = REGNO (reg); regno < end_regno; regno++)
if (state->last_set[regno].insn != 0)
{
unsigned int t;
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
t = (state->last_set[regno].time
+ insn_latency (state->last_set[regno].insn, insn));
while (state->time < t)
mips_sim_next_cycle (state);
}
}
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* A for_each_rtx callback. If *X is a register, advance simulation state
DATA until mips_sim_insn can read the register's value. */
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
static int
mips_sim_wait_regs_2 (rtx *x, void *data)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
{
if (REG_P (*x))
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
mips_sim_wait_reg ((struct mips_sim *) data, mips_sim_insn, *x);
return 0;
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
}
/* Call mips_sim_wait_regs_2 (R, DATA) for each register R mentioned in *X. */
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
static void
mips_sim_wait_regs_1 (rtx *x, void *data)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
{
for_each_rtx (x, mips_sim_wait_regs_2, data);
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
}
/* Advance simulation state STATE until all of INSN's register
dependencies are satisfied. */
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
static void
mips_sim_wait_regs (struct mips_sim *state, rtx insn)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
{
mips_sim_insn = insn;
note_uses (&PATTERN (insn), mips_sim_wait_regs_1, state);
}
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
/* Advance simulation state STATE until the units required by
instruction INSN are available. */
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
static void
mips_sim_wait_units (struct mips_sim *state, rtx insn)
{
state_t tmp_state;
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
tmp_state = alloca (state_size ());
while (state->insns_left == 0
|| (memcpy (tmp_state, state->dfa_state, state_size ()),
state_transition (tmp_state, insn) >= 0))
mips_sim_next_cycle (state);
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
}
/* Advance simulation state STATE until INSN is ready to issue. */
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
static void
mips_sim_wait_insn (struct mips_sim *state, rtx insn)
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
{
mips_sim_wait_regs (state, insn);
mips_sim_wait_units (state, insn);
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
}
/* mips_sim_insn has just set X. Update the LAST_SET array
in simulation state DATA. */
static void
mips_sim_record_set (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
{
struct mips_sim *state;
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
state = (struct mips_sim *) data;
if (REG_P (x))
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
{
unsigned int regno, end_regno;
end_regno = END_REGNO (x);
for (regno = REGNO (x); regno < end_regno; regno++)
{
state->last_set[regno].insn = mips_sim_insn;
state->last_set[regno].time = state->time;
}
}
}
/* Issue instruction INSN in scheduler state STATE. Assume that INSN
can issue immediately (i.e., that mips_sim_wait_insn has already
been called). */
static void
mips_sim_issue_insn (struct mips_sim *state, rtx insn)
{
state_transition (state->dfa_state, insn);
state->insns_left--;
mips_sim_insn = insn;
note_stores (PATTERN (insn), mips_sim_record_set, state);
}
/* Simulate issuing a NOP in state STATE. */
static void
mips_sim_issue_nop (struct mips_sim *state)
{
if (state->insns_left == 0)
mips_sim_next_cycle (state);
state->insns_left--;
}
/* Update simulation state STATE so that it's ready to accept the instruction
after INSN. INSN should be part of the main rtl chain, not a member of a
SEQUENCE. */
static void
mips_sim_finish_insn (struct mips_sim *state, rtx insn)
{
/* If INSN is a jump with an implicit delay slot, simulate a nop. */
if (JUMP_P (insn))
mips_sim_issue_nop (state);
switch (GET_CODE (SEQ_BEGIN (insn)))
{
case CODE_LABEL:
case CALL_INSN:
/* We can't predict the processor state after a call or label. */
mips_sim_reset (state);
break;
case JUMP_INSN:
/* The delay slots of branch likely instructions are only executed
when the branch is taken. Therefore, if the caller has simulated
the delay slot instruction, STATE does not really reflect the state
of the pipeline for the instruction after the delay slot. Also,
branch likely instructions tend to incur a penalty when not taken,
so there will probably be an extra delay between the branch and
the instruction after the delay slot. */
if (INSN_ANNULLED_BRANCH_P (SEQ_BEGIN (insn)))
mips_sim_reset (state);
break;
default:
break;
invoke.texi: Document -mvr4130-align. * doc/invoke.texi: Document -mvr4130-align. * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) (TUNE_MIPS4120, TUNE_MIPS4130): New macros. (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. * config/mips/mips.md: Include sched-int.h. (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. (override_options): Enable -mvr4130-align at -O3 and above. (mips_sim_insn): New variable. (mips_sim): New structure. (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. (mips_reorg): Call vr4130_align_insns. (vr4130_last_insn): New variable. (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) (vr4130_swap_insns_p, vr4130_reorder): New functions. (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. (mips_issue_rate): Return 2 for PROCESSOR_R4130. (mips_use_dfa_pipeline_interface): Return true for the same. * config/mips/4130.md: New file. * config/mips/mips.md: Include it. Add a peephole2 to convert "mult;mflo" into "mtlo;macc". (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the target of maccs. (*msac_using_macc): New pattern. From-SVN: r81567
2004-05-06 17:27:19 +02:00
}
}
/* The VR4130 pipeline issues aligned pairs of instructions together,
but it stalls the second instruction if it depends on the first.
In order to cut down the amount of logic required, this dependence
check is not based on a full instruction decode. Instead, any non-SPECIAL
instruction is assumed to modify the register specified by bits 20-16
(which is usually the "rt" field).
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
In BEQ, BEQL, BNE and BNEL instructions, the rt field is actually an
input, so we can end up with a false dependence between the branch
and its delay slot. If this situation occurs in instruction INSN,
try to avoid it by swapping rs and rt. */
static void
vr4130_avoid_branch_rt_conflict (rtx insn)
{
rtx first, second;
first = SEQ_BEGIN (insn);
second = SEQ_END (insn);
if (JUMP_P (first)
&& NONJUMP_INSN_P (second)
&& GET_CODE (PATTERN (first)) == SET
&& GET_CODE (SET_DEST (PATTERN (first))) == PC
&& GET_CODE (SET_SRC (PATTERN (first))) == IF_THEN_ELSE)
{
/* Check for the right kind of condition. */
rtx cond = XEXP (SET_SRC (PATTERN (first)), 0);
if ((GET_CODE (cond) == EQ || GET_CODE (cond) == NE)
&& REG_P (XEXP (cond, 0))
&& REG_P (XEXP (cond, 1))
&& reg_referenced_p (XEXP (cond, 1), PATTERN (second))
&& !reg_referenced_p (XEXP (cond, 0), PATTERN (second)))
{
/* SECOND mentions the rt register but not the rs register. */
rtx tmp = XEXP (cond, 0);
XEXP (cond, 0) = XEXP (cond, 1);
XEXP (cond, 1) = tmp;
}
}
}
/* Implement -mvr4130-align. Go through each basic block and simulate the
processor pipeline. If we find that a pair of instructions could execute
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
in parallel, and the first of those instructions is not 8-byte aligned,
insert a nop to make it aligned. */
static void
vr4130_align_insns (void)
{
struct mips_sim state;
rtx insn, subinsn, last, last2, next;
bool aligned_p;
dfa_start ();
/* LAST is the last instruction before INSN to have a nonzero length.
LAST2 is the last such instruction before LAST. */
last = 0;
last2 = 0;
/* ALIGNED_P is true if INSN is known to be at an aligned address. */
aligned_p = true;
mips_sim_init (&state, alloca (state_size ()));
for (insn = get_insns (); insn != 0; insn = next)
{
unsigned int length;
next = NEXT_INSN (insn);
/* See the comment above vr4130_avoid_branch_rt_conflict for details.
This isn't really related to the alignment pass, but we do it on
the fly to avoid a separate instruction walk. */
vr4130_avoid_branch_rt_conflict (insn);
if (USEFUL_INSN_P (insn))
FOR_EACH_SUBINSN (subinsn, insn)
{
mips_sim_wait_insn (&state, subinsn);
/* If we want this instruction to issue in parallel with the
previous one, make sure that the previous instruction is
aligned. There are several reasons why this isn't worthwhile
when the second instruction is a call:
config.sub: Import from master repository. 2002-08-15 Eric Christopher <echristo@redhat.com> * config.sub: Import from master repository. * config.guess: Ditto. 2002-08-15 Eric Christopher <echristo@redhat.com> Jeff Knaggs <jknaggs@redhat.com> * config.gcc (mipsisa64sr71k-elf): New target. * config/mips/sr71k.md: New file. * config/mips/mips.md: Use it. (rot*): Add sr71k specifics. * config/mips/t-sr71k: New file. * config/mips/mips.h (sr71k): New cpu. (TARGET_SR71K): Use it. (TUNE_SR71K): Ditto. (GENERATE_BRANCHLIKELY): Ditto. (ISA_HAS_MULHI, ISA_HAS_MULS, ISA_HAS_MSAC, ISA_HAS_MACC, ISA_HAS_ROTR_SIISA_HAS_ROTR_DI): Ditto. * config/mips/mips.c (sr71k): New cpu. (mips_use_dfa_pipeline_interface): Use. 2002-08-15 Eric Christopher <echristo@redhat.com> Richard Sandiford <rsandifo@redhat.com> Aldy Hernandez <aldyh@redhat.com> Graham Stott <grahams@redhat.com> Michael Meissner <meissner@redhat.com> Gavin Romig-Koch <gavin@redhat.com> Ken Raeburn <raeburn@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config.gcc (mips64vr-elf): New target. * config/mips/5400.md: New file. * config/mips/5500.md: Ditto. * config/mips/mips.md: Use them. (frsqrt): New. * config/mips/mips.c (vr4111, vr4121, vr4320, vr5400, vr5500): New cpus. (mips_issue_rate): Use them. (mips_use_dfa_pipeline_interface): New function. Use for 5400 and 5500. (TARGET_SCHEDUSE_DFA_PIPELINE_INTERFACE): Define. Use above. * config/mips/mips.h (vr4111, vr4121, vr4320, vr5400, vr5500): New cpus. (TARGET_MIPSx): Use them. (TUNE_MIPSx): Ditto. (GETNATE_MULT3_SI): Ditto. (ISA_HAS_BRANCHLIKELY): Ditto. (ISA_HAS_CONDMOVE): Ditto. (ISA_HAS_NMADD_NMSUB): Ditto. (ISA_HAS_MULHI): New. Ditto. (ISA_HAS_MULS): Ditto. (ISA_HAS_MSAC): Ditto. (ISA_HAS_MACC): Ditto. (ISA_HAS_ROTR_SI): Ditto. (ISA_HAS_ROTR_DI): Ditto. (RTX_COSTS): Use. From-SVN: r56471
2002-08-20 23:53:28 +02:00
- Calls are less likely to be performance critical,
- There's a good chance that the delay slot can execute
in parallel with the call.
- The return address would then be unaligned.
In general, if we're going to insert a nop between instructions
X and Y, it's better to insert it immediately after X. That
way, if the nop makes Y aligned, it will also align any labels
between X and Y. */
if (state.insns_left != state.issue_rate
&& !CALL_P (subinsn))
{
if (subinsn == SEQ_BEGIN (insn) && aligned_p)
{
/* SUBINSN is the first instruction in INSN and INSN is
aligned. We want to align the previous instruction
instead, so insert a nop between LAST2 and LAST.
Note that LAST could be either a single instruction
or a branch with a delay slot. In the latter case,
LAST, like INSN, is already aligned, but the delay
slot must have some extra delay that stops it from
issuing at the same time as the branch. We therefore
insert a nop before the branch in order to align its
delay slot. */
emit_insn_after (gen_nop (), last2);
aligned_p = false;
}
else if (subinsn != SEQ_BEGIN (insn) && !aligned_p)
{
/* SUBINSN is the delay slot of INSN, but INSN is
currently unaligned. Insert a nop between
LAST and INSN to align it. */
emit_insn_after (gen_nop (), last);
aligned_p = true;
}
}
mips_sim_issue_insn (&state, subinsn);
}
mips_sim_finish_insn (&state, insn);
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Update LAST, LAST2 and ALIGNED_P for the next instruction. */
length = get_attr_length (insn);
if (length > 0)
{
/* If the instruction is an asm statement or multi-instruction
mips.md patern, the length is only an estimate. Insert an
8 byte alignment after it so that the following instructions
can be handled correctly. */
if (NONJUMP_INSN_P (SEQ_BEGIN (insn))
&& (recog_memoized (insn) < 0 || length >= 8))
{
next = emit_insn_after (gen_align (GEN_INT (3)), insn);
next = NEXT_INSN (next);
mips_sim_next_cycle (&state);
aligned_p = true;
}
else if (length & 4)
aligned_p = !aligned_p;
last2 = last;
last = insn;
}
/* See whether INSN is an aligned label. */
if (LABEL_P (insn) && label_to_alignment (insn) >= 3)
aligned_p = true;
}
dfa_finish ();
}
/* This structure records that the current function has a LO_SUM
involving SYMBOL_REF or LABEL_REF BASE and that MAX_OFFSET is
the largest offset applied to BASE by all such LO_SUMs. */
struct mips_lo_sum_offset {
rtx base;
HOST_WIDE_INT offset;
};
/* Return a hash value for SYMBOL_REF or LABEL_REF BASE. */
static hashval_t
mips_hash_base (rtx base)
{
int do_not_record_p;
return hash_rtx (base, GET_MODE (base), &do_not_record_p, NULL, false);
}
/* Hash-table callbacks for mips_lo_sum_offsets. */
static hashval_t
mips_lo_sum_offset_hash (const void *entry)
{
return mips_hash_base (((const struct mips_lo_sum_offset *) entry)->base);
}
static int
mips_lo_sum_offset_eq (const void *entry, const void *value)
{
return rtx_equal_p (((const struct mips_lo_sum_offset *) entry)->base,
(const_rtx) value);
}
/* Look up symbolic constant X in HTAB, which is a hash table of
mips_lo_sum_offsets. If OPTION is NO_INSERT, return true if X can be
paired with a recorded LO_SUM, otherwise record X in the table. */
static bool
mips_lo_sum_offset_lookup (htab_t htab, rtx x, enum insert_option option)
{
rtx base, offset;
void **slot;
struct mips_lo_sum_offset *entry;
/* Split X into a base and offset. */
split_const (x, &base, &offset);
if (UNSPEC_ADDRESS_P (base))
base = UNSPEC_ADDRESS (base);
/* Look up the base in the hash table. */
slot = htab_find_slot_with_hash (htab, base, mips_hash_base (base), option);
if (slot == NULL)
return false;
entry = (struct mips_lo_sum_offset *) *slot;
if (option == INSERT)
{
if (entry == NULL)
{
entry = XNEW (struct mips_lo_sum_offset);
entry->base = base;
entry->offset = INTVAL (offset);
*slot = entry;
}
else
{
if (INTVAL (offset) > entry->offset)
entry->offset = INTVAL (offset);
}
}
return INTVAL (offset) <= entry->offset;
}
/* A for_each_rtx callback for which DATA is a mips_lo_sum_offset hash table.
Record every LO_SUM in *LOC. */
static int
mips_record_lo_sum (rtx *loc, void *data)
{
if (GET_CODE (*loc) == LO_SUM)
mips_lo_sum_offset_lookup ((htab_t) data, XEXP (*loc, 1), INSERT);
return 0;
}
/* Return true if INSN is a SET of an orphaned high-part relocation.
HTAB is a hash table of mips_lo_sum_offsets that describes all the
LO_SUMs in the current function. */
static bool
mips_orphaned_high_part_p (htab_t htab, rtx insn)
{
enum mips_symbol_type type;
rtx x, set;
set = single_set (insn);
if (set)
{
/* Check for %his. */
x = SET_SRC (set);
if (GET_CODE (x) == HIGH
&& absolute_symbolic_operand (XEXP (x, 0), VOIDmode))
return !mips_lo_sum_offset_lookup (htab, XEXP (x, 0), NO_INSERT);
/* Check for local %gots (and %got_pages, which is redundant but OK). */
if (GET_CODE (x) == UNSPEC
&& XINT (x, 1) == UNSPEC_LOAD_GOT
&& mips_symbolic_constant_p (XVECEXP (x, 0, 1),
SYMBOL_CONTEXT_LEA, &type)
&& type == SYMBOL_GOTOFF_PAGE)
return !mips_lo_sum_offset_lookup (htab, XVECEXP (x, 0, 1), NO_INSERT);
}
return false;
}
/* Subroutine of mips_reorg_process_insns. If there is a hazard between
INSN and a previous instruction, avoid it by inserting nops after
instruction AFTER.
*DELAYED_REG and *HILO_DELAY describe the hazards that apply at
this point. If *DELAYED_REG is non-null, INSN must wait a cycle
before using the value of that register. *HILO_DELAY counts the
number of instructions since the last hilo hazard (that is,
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
the number of instructions since the last MFLO or MFHI).
After inserting nops for INSN, update *DELAYED_REG and *HILO_DELAY
for the next instruction.
LO_REG is an rtx for the LO register, used in dependence checking. */
static void
mips_avoid_hazard (rtx after, rtx insn, int *hilo_delay,
rtx *delayed_reg, rtx lo_reg)
{
rtx pattern, set;
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
int nops, ninsns;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
pattern = PATTERN (insn);
/* Do not put the whole function in .set noreorder if it contains
an asm statement. We don't know whether there will be hazards
between the asm statement and the gcc-generated code. */
if (GET_CODE (pattern) == ASM_INPUT || asm_noperands (pattern) >= 0)
cfun->machine->all_noreorder_p = false;
/* Ignore zero-length instructions (barriers and the like). */
ninsns = get_attr_length (insn) / 4;
if (ninsns == 0)
return;
/* Work out how many nops are needed. Note that we only care about
registers that are explicitly mentioned in the instruction's pattern.
It doesn't matter that calls use the argument registers or that they
clobber hi and lo. */
if (*hilo_delay < 2 && reg_set_p (lo_reg, pattern))
nops = 2 - *hilo_delay;
else if (*delayed_reg != 0 && reg_referenced_p (*delayed_reg, pattern))
nops = 1;
else
nops = 0;
/* Insert the nops between this instruction and the previous one.
Each new nop takes us further from the last hilo hazard. */
*hilo_delay += nops;
while (nops-- > 0)
emit_insn_after (gen_hazard_nop (), after);
/* Set up the state for the next instruction. */
*hilo_delay += ninsns;
*delayed_reg = 0;
if (INSN_CODE (insn) >= 0)
switch (get_attr_hazard (insn))
{
case HAZARD_NONE:
break;
config.gcc (mips*-*-*): Rename MASK_SPLIT_ADDRS to MASK_SPLIT_ADDRESSES. * config.gcc (mips*-*-*): Rename MASK_SPLIT_ADDRS to MASK_SPLIT_ADDRESSES. * config/mips/mips.h (target_flags, mips_fix_vr4130_string): Delete. (MASK_INT64, MASK_LONG64, MASK_SPLIT_ADDR, MASK_NO_FUSED_MADD) (MASK_EXPLICIT_RELOCS, MASK_MEMCPY, MASK_SOFT_FLOAT) (MASK_FLOAT64, MASK_ABICALLS, MASK_XGOT, MASK_LONG_CALLS) (MASK_64BIT, MASK_EMBEDDED_DATA, MASK_BIG_ENDIAN) (MASK_SINGLE_FLOAT, MASK_MAD, MASK_4300_MUL_FIX, MASK_MIPS16) (MASK_NO_CHECK_ZERO_DIV, MASK_BRANCHLIKELY) (MASK_UNINIT_CONST_IN_RODATA, MASK_FIX_R4000, MASK_FIX_R4400) (MASK_FIX_SB1, MASK_FIX_VR4120, MASK_VR4130_ALIGN) (MASK_FP_EXCEPTIONS, MASK_DIVIDE_BREAKS, MASK_PAIRED_SINGLE) (MASK_MIPS3D, MASK_SYM32, MASK_DEBUG, MASK_DEBUG_D) (MASK_MIPS_TFILE, TARGET_INT64, TARGET_LONG64, TARGET_FLOAT64) (TARGET_64BIT, TARGET_SPLIT_ADDRESSES, TARGET_DEBUG_MODE) (TARGET_DEBUG_D_MODE, TARGET_MEMCPY, TARGET_ABICALLS) (TARGET_XGOT, TARGET_SOFT_FLOAT, TARGET_HARD_FLOAT) (TARGET_LONG_CALLS, TARGET_EMBEDDED_DATA) (TARGET_UNINIT_CONST_IN_RODATA, TARGET_BIG_ENDIAN) (TARGET_SINGLE_FLOAT, TARGET_DOUBLE_FLOAT, TARGET_MAD) (TARGET_FUSED_MADD, TARGET_4300_MUL_FIX, TARGET_CHECK_ZERO_DIV) (TARGET_DIVIDE_TRAPS, TARGET_BRANCHLIKELY, TARGET_FIX_SB1) (TARGET_FIX_R4000, TARGET_FIX_R4400, TARGET_FIX_VR4120) (TARGET_FIX_VR4130, TARGET_VR4130_ALIGN, TARGET_FP_EXCEPTIONS) (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D, TARGET_SYM32) (TARGET_EXPLICIT_RELOCS): Delete. (TARGET_SWITCHES, SUBTARGET_TARGET_SWITCHES): Delete. (TARGET_OPTIONS): Remove entry for -mfix-vr4130. * config/mips/mips.c (TARGET_DEFAULT_TARGET_FLAGS): Define. (override_options): Set MASK_LONG64 if -mint64 is given and no -mlongXX option is. Complain about -mint64 -mlong32. (override_options, CMP_BUILTINS, mips_bdesc, sb1_desc): Rename MASK_PAIRED_SINGLE to MASK_PAIRED_SINGLE_FLOAT. * config/mips/mips.opt: New file. From-SVN: r96452
2005-03-14 21:40:57 +01:00
case HAZARD_HILO:
*hilo_delay = 0;
break;
case HAZARD_DELAY:
re PR target/34981 (Lazily-bound function called twice) gcc/ PR target/34981 * config/mips/mips-protos.h (mips_expand_call): Return an rtx. * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Rename FAKE_CALL_REGNO to GOT_VERSION_REGNUM. (CALL_REALLY_USED_REGISTERS): Set the GOT_VERSION_REGNUM entry to 0. (EPILOGUE_USES): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. * config/mips/mips.c (mips_emit_call_insn): New function. (mips_call_tls_get_addr): Call mips_expand_call directly. (mips16_copy_fpr_return_value): Use mips_emit_call_insn rather than emit_call_insn. (mips16_build_call_stub): Likewise. Return the call insn or null. (mips_expand_call): Update the call to mips16_build_call_stub accordingly and a remove redundant condition. Assert that MIPS16 stubs do not use lazy binding. Use mips_emit_call_insn and return the call insn. (mips_extra_live_on_entry): Include GOT_VERSION_REGNUM if TARGET_USE_GOT. (mips_hard_regno_mode_ok_p): Allow SImode for GOT_VERSION_REGNUM. (mips_avoid_hazard): Remove hazard_set handling. * config/mips/mips.md (UNSPEC_EH_RECEIVER): Rename to... (UNSPEC_RESTORE_GP): ...this. (UNSPEC_SET_GOT_VERSION, UNSPEC_UPDATE_GOT_VERSION): New constants. (FAKE_CALL_REGNO): Rename to... (GOT_VERSION_REGNUM): ...this. (type): Add "ghost" value. Add an associated insn reservation. (hazard_set): Remove. (exception_receiver): Rename to... (restore_gp): ...this and update the unspec identifier accordingly. (exception_receiver, nonlocal_got_receiver): New expanders. (load_call<mode>): Use GOT_VERSION_REGNUM. Don't set FAKE_CALL_REGNO. Remove hazard_set attribute. (set_got_version, update_got_version): New patterns. gcc/testsuite/ PR target/34981 * gcc.target/mips/lazy-binding-1.c: New test. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_forced_no_abicalls and mips_forced_no_shared. (dg-mips-options): Avoid using -mabicalls with an implicit -mabi=eabi. Avoid using small data with -mabicalls. Don't make -G0 force -mn-abicalls. Skip -mabicalls and -mshared tests if the multilib forces the opposite option. From-SVN: r131860
2008-01-26 11:22:14 +01:00
set = single_set (insn);
gcc_assert (set);
*delayed_reg = SET_DEST (set);
break;
}
}
/* Go through the instruction stream and insert nops where necessary.
Also delete any high-part relocations whose partnering low parts
are now all dead. See if the whole function can then be put into
.set noreorder and .set nomacro. */
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
static void
mips_reorg_process_insns (void)
{
rtx insn, last_insn, subinsn, next_insn, lo_reg, delayed_reg;
int hilo_delay;
htab_t htab;
/* Force all instructions to be split into their final form. */
split_all_insns_noflow ();
/* Recalculate instruction lengths without taking nops into account. */
cfun->machine->ignore_hazard_length_p = true;
shorten_branches (get_insns ());
cfun->machine->all_noreorder_p = true;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* We don't track MIPS16 PC-relative offsets closely enough to make
a good job of "set .noreorder" code in MIPS16 mode. */
if (TARGET_MIPS16)
cfun->machine->all_noreorder_p = false;
/* Code that doesn't use explicit relocs can't be ".set nomacro". */
if (!TARGET_EXPLICIT_RELOCS)
cfun->machine->all_noreorder_p = false;
/* Profiled functions can't be all noreorder because the profiler
support uses assembler macros. */
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
if (crtl->profile)
cfun->machine->all_noreorder_p = false;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Code compiled with -mfix-vr4120 can't be all noreorder because
we rely on the assembler to work around some errata. */
if (TARGET_FIX_VR4120)
cfun->machine->all_noreorder_p = false;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The same is true for -mfix-vr4130 if we might generate MFLO or
MFHI instructions. Note that we avoid using MFLO and MFHI if
the VR4130 MACC and DMACC instructions are available instead;
see the *mfhilo_{si,di}_macc patterns. */
if (TARGET_FIX_VR4130 && !ISA_HAS_MACCHI)
cfun->machine->all_noreorder_p = false;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
htab = htab_create (37, mips_lo_sum_offset_hash,
mips_lo_sum_offset_eq, free);
/* Make a first pass over the instructions, recording all the LO_SUMs. */
for (insn = get_insns (); insn != 0; insn = NEXT_INSN (insn))
FOR_EACH_SUBINSN (subinsn, insn)
if (INSN_P (subinsn))
for_each_rtx (&PATTERN (subinsn), mips_record_lo_sum, htab);
last_insn = 0;
hilo_delay = 2;
delayed_reg = 0;
lo_reg = gen_rtx_REG (SImode, LO_REGNUM);
/* Make a second pass over the instructions. Delete orphaned
high-part relocations or turn them into NOPs. Avoid hazards
by inserting NOPs. */
for (insn = get_insns (); insn != 0; insn = next_insn)
{
next_insn = NEXT_INSN (insn);
if (INSN_P (insn))
{
if (GET_CODE (PATTERN (insn)) == SEQUENCE)
{
/* If we find an orphaned high-part relocation in a delay
slot, it's easier to turn that instruction into a NOP than
to delete it. The delay slot will be a NOP either way. */
FOR_EACH_SUBINSN (subinsn, insn)
if (INSN_P (subinsn))
{
if (mips_orphaned_high_part_p (htab, subinsn))
{
PATTERN (subinsn) = gen_nop ();
INSN_CODE (subinsn) = CODE_FOR_nop;
}
mips_avoid_hazard (last_insn, subinsn, &hilo_delay,
&delayed_reg, lo_reg);
}
last_insn = insn;
}
else
{
/* INSN is a single instruction. Delete it if it's an
orphaned high-part relocation. */
if (mips_orphaned_high_part_p (htab, insn))
delete_insn (insn);
else
{
mips_avoid_hazard (last_insn, insn, &hilo_delay,
&delayed_reg, lo_reg);
last_insn = insn;
}
}
}
}
htab_delete (htab);
}
/* Implement TARGET_MACHINE_DEPENDENT_REORG. */
static void
mips_reorg (void)
{
mips16_lay_out_constants ();
if (mips_base_delayed_branch)
dbr_schedule (get_insns ());
mips_reorg_process_insns ();
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (!TARGET_MIPS16
&& TARGET_EXPLICIT_RELOCS
&& TUNE_MIPS4130
&& TARGET_VR4130_ALIGN)
vr4130_align_insns ();
}
/* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text
in order to avoid duplicating too much logic from elsewhere. */
static void
mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
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, temp1, temp2, insn, fnaddr;
bool use_sibcall_p;
/* Pretend to be a post-reload pass while generating rtl. */
reload_completed = 1;
/* Mark the end of the (empty) prologue. */
emit_note (NOTE_INSN_PROLOGUE_END);
/* Determine if we can use a sibcall to call FUNCTION directly. */
fnaddr = XEXP (DECL_RTL (function), 0);
use_sibcall_p = (mips_function_ok_for_sibcall (function, NULL)
&& const_call_insn_operand (fnaddr, Pmode));
/* Determine if we need to load FNADDR from the GOT. */
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (!use_sibcall_p
&& (mips_got_symbol_type_p
(mips_classify_symbol (fnaddr, SYMBOL_CONTEXT_LEA))))
{
/* Pick a global pointer. Use a call-clobbered register if
TARGET_CALL_SAVED_GP. */
cfun->machine->global_pointer
= TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM;
SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
/* Set up the global pointer for n32 or n64 abicalls. */
mips_emit_loadgp ();
}
/* We need two temporary registers in some cases. */
temp1 = gen_rtx_REG (Pmode, 2);
temp2 = gen_rtx_REG (Pmode, 3);
/* Find out which register contains the "this" pointer. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
this_rtx = gen_rtx_REG (Pmode, GP_ARG_FIRST + 1);
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
this_rtx = gen_rtx_REG (Pmode, GP_ARG_FIRST);
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
/* Add DELTA to THIS_RTX. */
if (delta != 0)
{
rtx offset = GEN_INT (delta);
if (!SMALL_OPERAND (delta))
{
mips_emit_move (temp1, offset);
offset = temp1;
}
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_add3_insn (this_rtx, this_rtx, offset));
}
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 needed, add *(*THIS_RTX + VCALL_OFFSET) to THIS_RTX. */
if (vcall_offset != 0)
{
rtx addr;
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
/* Set TEMP1 to *THIS_RTX. */
mips_emit_move (temp1, gen_rtx_MEM (Pmode, this_rtx));
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
/* Set ADDR to a legitimate address for *THIS_RTX + VCALL_OFFSET. */
addr = mips_add_offset (temp2, temp1, vcall_offset);
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
/* Load the offset and add it to THIS_RTX. */
mips_emit_move (temp1, gen_rtx_MEM (Pmode, addr));
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_add3_insn (this_rtx, this_rtx, temp1));
}
/* Jump to the target function. Use a sibcall if direct jumps are
allowed, otherwise load the address into a register first. */
if (use_sibcall_p)
{
insn = emit_call_insn (gen_sibcall_internal (fnaddr, const0_rtx));
SIBLING_CALL_P (insn) = 1;
}
else
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* This is messy. GAS treats "la $25,foo" as part of a call
sequence and may allow a global "foo" to be lazily bound.
The general move patterns therefore reject this combination.
In this context, lazy binding would actually be OK
for TARGET_CALL_CLOBBERED_GP, but it's still wrong for
TARGET_CALL_SAVED_GP; see mips_load_call_address.
We must therefore load the address via a temporary
register if mips_dangerous_for_la25_p.
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
If we jump to the temporary register rather than $25,
the assembler can use the move insn to fill the jump's
delay slot.
We can use the same technique for MIPS16 code, where $25
is not a valid JR register. */
if (TARGET_USE_PIC_FN_ADDR_REG
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
&& !TARGET_MIPS16
&& !mips_dangerous_for_la25_p (fnaddr))
temp1 = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
mips_load_call_address (MIPS_CALL_SIBCALL, temp1, fnaddr);
if (TARGET_USE_PIC_FN_ADDR_REG
&& REGNO (temp1) != PIC_FUNCTION_ADDR_REGNUM)
mips_emit_move (gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM), temp1);
emit_jump_insn (gen_indirect_jump (temp1));
}
/* Run just enough of rest_of_compilation. This sequence was
"borrowed" from alpha.c. */
insn = get_insns ();
insn_locators_alloc ();
split_all_insns_noflow ();
mips16_lay_out_constants ();
shorten_branches (insn);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
free_after_compilation (cfun);
/* Clean up the vars set above. Note that final_end_function resets
the global pointer for us. */
reload_completed = 0;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* The last argument passed to mips_set_mips16_mode, or negative if the
function hasn't been called yet.
There are two copies of this information. One is saved and restored
by the PCH process while the other is specific to this compiler
invocation. The information calculated by mips_set_mips16_mode
is invalid unless the two variables are the same. */
static int was_mips16_p = -1;
static GTY(()) int was_mips16_pch_p = -1;
/* Set up the target-dependent global state so that it matches the
current function's ISA mode. */
static void
mips_set_mips16_mode (int mips16_p)
{
if (mips16_p == was_mips16_p
&& mips16_p == was_mips16_pch_p)
return;
/* Restore base settings of various flags. */
target_flags = mips_base_target_flags;
flag_schedule_insns = mips_base_schedule_insns;
flag_reorder_blocks_and_partition = mips_base_reorder_blocks_and_partition;
flag_move_loop_invariants = mips_base_move_loop_invariants;
align_loops = mips_base_align_loops;
align_jumps = mips_base_align_jumps;
align_functions = mips_base_align_functions;
if (mips16_p)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Switch to MIPS16 mode. */
target_flags |= MASK_MIPS16;
/* Don't run the scheduler before reload, since it tends to
increase register pressure. */
flag_schedule_insns = 0;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Don't do hot/cold partitioning. mips16_lay_out_constants expects
the whole function to be in a single section. */
flag_reorder_blocks_and_partition = 0;
/* Don't move loop invariants, because it tends to increase
register pressure. It also introduces an extra move in cases
where the constant is the first operand in a two-operand binary
instruction, or when it forms a register argument to a functon
call. */
flag_move_loop_invariants = 0;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
target_flags |= MASK_EXPLICIT_RELOCS;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Experiments suggest we get the best overall section-anchor
results from using the range of an unextended LW or SW. Code
that makes heavy use of byte or short accesses can do better
with ranges of 0...31 and 0...63 respectively, but most code is
sensitive to the range of LW and SW instead. */
targetm.min_anchor_offset = 0;
targetm.max_anchor_offset = 127;
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu. * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. * configure: Regenerate. config/ * mt-mips16-compat: New file, taken from mt-mips-elfoabi. * mt-mips-elfoabi: Include mt-mips16-compat. * mt-mips-gnu: New file. gcc/ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add mips/t-libgcc-mips16 to tmake_file. * config/mips/mips-protos.h (mips_call_type): New enum. (mips_pic_base_register, mips_got_load): Declare. (mips_restore_gp): Take an rtx argument. (mips_use_pic_fn_addr_reg_p): Declare. (mips_expand_call): Replace the sibcall_p argument with a mips_call_type argument. Add a lazy_p parameter. (mips_split_call): Declare. * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro. (MIPS16_PIC_TEMP): Likewise. (reg_class): Delete M16_NA_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros. (mips_split_hi_p): Declare. * config/mips/mips.c (mips_split_hi_p): New array. (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS. (mips_got_symbol_type_p): New function. (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P. (mips16_stub_function_p): New function. (mips16_local_function_p): Likewise. (mips_use_pic_fn_addr_reg_p): Likewise. (mips_cannot_force_const_mem): Return false for HIGHs. Extend CONST_INT and symbolic handling to MIPS16, using mips_symbol_insns to check that the base symbol type is a legitimate constant. Reject GOT-based constants if TARGET_MIPS16_PCREL_LOADS. (mips_const_insns): Check targetm.cannot_force_const_mem when decomposing a symbolic base and a large offset. (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters. When calling a function that needs $25 from MIPS16 code, move the target address into $25 separately and add a USE to the call insn. (mips16_gp_pseudo_reg): Insert the initializer immediately before the first real insn. (mips_pic_base_register, mips_got_load): New functions. (mips_split_symbol): Generalize the name of the LO_SUM_OUT parameter to LOW_OUT. Say that it can be any valid SET_SRC when splitting a load-address operation. Split SYMBOL_GOT_DISP constants and highs of SYMBOL_GOT_PAGE_OFST constants. (mips_call_tls_get_addr): Update the call to mips_expand_call, also passing NULL_RTX rather than const0_rtx as the aux argument. (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p instead of TARGET_EXPLICIT_RELOCS. (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P. (mips_load_call_address): Replace the sibcall_p argument with a mips_call_type argument. Use mips_got_load. (mips16_local_alias): New structure. (mips16_local_aliases): New variable. (mips16_local_aliases_hash): New function. (mips16_local_aliases_eq): Likewise. (mips16_local_alias): Likewise. (mips16_stub_function): Likewise. (mips16_build_function_stub): Create a local alias for the target function. Handle TARGET_ABICALLS. For PIC abicalls, emit a .cpload directive and an R_MIPS_NONE relocation for the target function, then load the alias rather than the function itself. Wrap the non-PIC abicalls version in ".option pic0/.option pic2". (mips16_copy_fpr_return_value): Use mips16_stub_function and mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol. (mips16_build_call_stub): Replace the FN parameter with an FN_PTR parameter. Force the address into a register if it isn't a call_insn_operand; don't rely on the caller to do this. If a call to a locally-defined and locally-binding MIPS16 function must be made indirectly, redirect the call to the function's local alias. Use mips16_stub_function_p, mips16_stub_function, mips_expand_call and use_reg. Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols. Use explicit %hi and %lo accesses where possible. Use MIPS_CALL to generate the correct code form of a jal instruction. Add clobbers of $18 instead of uses. Update the call to mips_emit_call_insn. (mips_expand_call): Replace the SIBCALL_P argument with a mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value. Take a LAZY_P parameter. Call mips16_build_call_stub first, allowing it to modify the call address. Update the calls to mips_load_call_address and mips_emit_call_insn. (mips_split_call): New function. (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of SYMBOL_GOT_PAGE_OFST, for MIPS16 code. (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p. (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM if TARGET_MIPS16. (mips_cprestore_slot): New function. (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16 and use mips_cprestore_slot. (mips_output_function_prologue): Handle TARGET_MIPS16 for LOADGP_OLDABI. (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16, then use a copygp_mips16 instruction to set up $28. (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too. (mips16_lay_out_constants): Call split_all_insns_noflow. (mips_reorg_process_insns): Explicitly set all_noreorder_p to false if TARGET_MIPS16. (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16. (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the mips_dangerous_for_la25_p approach for MIPS16 PIC calls too. (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for MIPS16 code. Allow MIPS16 o32 PIC. (mips_override_options): Allow MIPS16 o32 PIC. * config/mips/mips.md: Lower CONST_GP_P moves into register moves after reload if TARGET_USE_GOT. (UNSPEC_COPYGP): New constant. (length): Use a default length of 8 for MIPS16 GOT loads. (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT. (*got_page<mode>): Check mips_split_hi_p. (*got_disp<mode>, *got_page<mode>): Use mips_got_load. (unspec_got<mode>, unspec_call<mode>): New expanders. (load_got<mode>, load_call<mode>): Remove the length attributes. Use a got attribute instead of a type attribute. (copygp_mips16): New insn. (restore_gp): Add a scratch clobber and pass it to mips_restore_gp. (load_call<mode>): Use a "d" constraint instead of an "r" constraint. (sibcall, sibcall_value, call, call_value): Update the calls to mips_expand_call. (call_internal, call_value_internal): Use mips_split_call. (call_value_multiple_internal): Likewise. (call_split): Move after call_internal (the insn it is split from). (call_internal_direct, call_value_internal_direct): Turn into define_insn_and_splits. Split if TARGET_SPLIT_CALLS. (call_direct_split, call_value_direct_split): New patterns. * config/mips/constraints.md (c): Handle TARGET_MIPS16 first and use M16_REGS instead of M16_NA_REGS. * config/mips/predicates.md (const_call_insn_operand): Replace the TARGET_ABSOLUTE_ABICALLS-based check with a more general mips_use_pic_fn_addr_reg_p check. (move_operand): Reject HIGHs if mips_split_hi_p. * config/mips/mips16.S: Assembly as empty if the ABI is not suitable. (__mips16_floatunsisf): Inline __mips16_floatsisf. (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25. * config/mips/libgcc-mips16.ver: New file. * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add $(srcdir)/config/mips/libgcc-mips16.ver. gcc/testsuite/ * lib/target-supports.exp (check_profiling_available): Return false for -p and -pg on MIPS16 targets. From-SVN: r138912
2008-08-09 21:08:15 +02:00
if (flag_pic && !TARGET_OLDABI)
sorry ("MIPS16 PIC for ABIs other than o32 and o64");
if (TARGET_XGOT)
sorry ("MIPS16 -mxgot code");
if (TARGET_HARD_FLOAT_ABI && !TARGET_OLDABI)
sorry ("hard-float MIPS16 code for ABIs other than o32 and o64");
}
else
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Switch to normal (non-MIPS16) mode. */
target_flags &= ~MASK_MIPS16;
/* Provide default values for align_* for 64-bit targets. */
if (TARGET_64BIT)
{
if (align_loops == 0)
align_loops = 8;
if (align_jumps == 0)
align_jumps = 8;
if (align_functions == 0)
align_functions = 8;
}
targetm.min_anchor_offset = -32768;
targetm.max_anchor_offset = 32767;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* (Re)initialize MIPS target internals for new ISA. */
mips_init_relocs ();
if (was_mips16_p >= 0 || was_mips16_pch_p >= 0)
/* Reinitialize target-dependent state. */
target_reinit ();
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
was_mips16_p = mips16_p;
was_mips16_pch_p = mips16_p;
}
/* Implement TARGET_SET_CURRENT_FUNCTION. Decide whether the current
function should use the MIPS16 ISA and switch modes accordingly. */
static void
mips_set_current_function (tree fndecl)
{
mips_set_mips16_mode (mips_use_mips16_mode_p (fndecl));
}
/* Allocate a chunk of memory for per-function machine-dependent data. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
static struct machine_function *
mips_init_machine_status (void)
{
return ((struct machine_function *)
ggc_alloc_cleared (sizeof (struct machine_function)));
}
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Return the processor associated with the given ISA level, or null
if the ISA isn't valid. */
static const struct mips_cpu_info *
mips_cpu_info_from_isa (int isa)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE (mips_cpu_info_table); i++)
if (mips_cpu_info_table[i].isa == isa)
return mips_cpu_info_table + i;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return NULL;
}
/* Return true if GIVEN is the same as CANONICAL, or if it is CANONICAL
with a final "000" replaced by "k". Ignore case.
Note: this function is shared between GCC and GAS. */
static bool
mips_strict_matching_cpu_name_p (const char *canonical, const char *given)
{
while (*given != 0 && TOLOWER (*given) == TOLOWER (*canonical))
given++, canonical++;
return ((*given == 0 && *canonical == 0)
|| (strcmp (canonical, "000") == 0 && strcasecmp (given, "k") == 0));
}
/* Return true if GIVEN matches CANONICAL, where GIVEN is a user-supplied
CPU name. We've traditionally allowed a lot of variation here.
Note: this function is shared between GCC and GAS. */
static bool
mips_matching_cpu_name_p (const char *canonical, const char *given)
{
/* First see if the name matches exactly, or with a final "000"
turned into "k". */
if (mips_strict_matching_cpu_name_p (canonical, given))
return true;
/* If not, try comparing based on numerical designation alone.
See if GIVEN is an unadorned number, or 'r' followed by a number. */
if (TOLOWER (*given) == 'r')
given++;
if (!ISDIGIT (*given))
return false;
/* Skip over some well-known prefixes in the canonical name,
hoping to find a number there too. */
if (TOLOWER (canonical[0]) == 'v' && TOLOWER (canonical[1]) == 'r')
canonical += 2;
else if (TOLOWER (canonical[0]) == 'r' && TOLOWER (canonical[1]) == 'm')
canonical += 2;
else if (TOLOWER (canonical[0]) == 'r')
canonical += 1;
return mips_strict_matching_cpu_name_p (canonical, given);
}
/* Return the mips_cpu_info entry for the processor or ISA given
by CPU_STRING. Return null if the string isn't recognized.
A similar function exists in GAS. */
static const struct mips_cpu_info *
mips_parse_cpu (const char *cpu_string)
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
{
unsigned int i;
const char *s;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* In the past, we allowed upper-case CPU names, but it doesn't
work well with the multilib machinery. */
for (s = cpu_string; *s != 0; s++)
if (ISUPPER (*s))
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
warning (0, "CPU names must be lower case");
break;
}
/* 'from-abi' selects the most compatible architecture for the given
ABI: MIPS I for 32-bit ABIs and MIPS III for 64-bit ABIs. For the
EABIs, we have to decide whether we're using the 32-bit or 64-bit
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
version. */
if (strcasecmp (cpu_string, "from-abi") == 0)
return mips_cpu_info_from_isa (ABI_NEEDS_32BIT_REGS ? 1
: ABI_NEEDS_64BIT_REGS ? 3
: (TARGET_64BIT ? 3 : 1));
/* 'default' has traditionally been a no-op. Probably not very useful. */
if (strcasecmp (cpu_string, "default") == 0)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return NULL;
for (i = 0; i < ARRAY_SIZE (mips_cpu_info_table); i++)
if (mips_matching_cpu_name_p (mips_cpu_info_table[i].name, cpu_string))
return mips_cpu_info_table + i;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
return NULL;
}
/* Set up globals to generate code for the ISA or processor
described by INFO. */
static void
mips_set_architecture (const struct mips_cpu_info *info)
{
if (info != 0)
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
{
mips_arch_info = info;
mips_arch = info->cpu;
mips_isa = info->isa;
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
}
}
Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> Add mips16/nomips16 function attributes and -mflip-mips16 option for testing mixed-mode compilation. gcc/ * config/mips/mips.opt (mflip-mips16): New. * config/mips/mips.h (SYMBOL_FLAG_MIPS16_FUNC): Define. (SYMBOL_FLAG_MIPS16_FUNC_P): Define. * config/mips/mips.c (mips_base_target_flags): New. (mips_base_mips16): New. (mips_base_schedule_insns): New. (mips_base_reorder_blocks_and_partition): New. (mips_base_align_loops): New. (mips_base_align_jumps): New. (mips_base_align_functions): New. (mips16_flipper): New. (mips_attribute_table): Add "mips16" and "nomips16" entries. (TARGET_SET_CURRENT_FUNCTION): Define. (mips_mips16_type_p, mips_nomips16_type_p): New. (mips_comp_type_attributes): Check mips16/nomips16 attributes. (mips_function_ok_for_sibcall): Make it deal with functions with mips16 attributes. (mips_init_split_addresses): New, split out from override_options. (mips_init_relocs): New, split out from override_options. (was_mips16_p): New. (mips_set_mips16_mode): New, split out from override_options. (mips_set_current_function): New. (override_options): Add sorry for unsupported mips16/pic combination. Remove error for mips16/dsp combination. Save base option settings. (mips_file_start): Move mips16 mode setting output from here.... (mips_output_function_prologue): ....to here. (mips_output_mi_thunk): Check for mips16 function. (build_mips16_function_stub): Don't set .mips16 here. (build_mips16_call_stub): Likewise. (mips_expand_builtin): Error in mips16 mode. (mips_use_mips16_mode_p): New. (mips_encode_section_info): Check for mips16 function, and set SYMBOL_REF_FLAGS accordingly. * doc/extend.texi (Function Attributes): Document new mips16/nomips16 attributes. * doc/invoke.texi (Option Summary): Add -mflip-mips16. (MIPS Options): Document -mflip-mips16. gcc/testsuite/ * gcc.target/mips/mips16-attributes.c: New. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r128134
2007-09-05 16:40:04 +02:00
/* Likewise for tuning. */
static void
mips_set_tune (const struct mips_cpu_info *info)
{
if (info != 0)
{
mips_tune_info = info;
mips_tune = info->cpu;
}
}
/* Implement TARGET_HANDLE_OPTION. */
static bool
mips_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
{
switch (code)
{
case OPT_mabi_:
if (strcmp (arg, "32") == 0)
mips_abi = ABI_32;
else if (strcmp (arg, "o64") == 0)
mips_abi = ABI_O64;
else if (strcmp (arg, "n32") == 0)
mips_abi = ABI_N32;
else if (strcmp (arg, "64") == 0)
mips_abi = ABI_64;
else if (strcmp (arg, "eabi") == 0)
mips_abi = ABI_EABI;
else
return false;
return true;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
case OPT_march_:
case OPT_mtune_:
return mips_parse_cpu (arg) != 0;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
case OPT_mips:
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_isa_option_info = mips_parse_cpu (ACONCAT (("mips", arg, NULL)));
return mips_isa_option_info != 0;
case OPT_mno_flush_func:
mips_cache_flush_func = NULL;
return true;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
case OPT_mcode_readable_:
if (strcmp (arg, "yes") == 0)
mips_code_readable = CODE_READABLE_YES;
else if (strcmp (arg, "pcrel") == 0)
mips_code_readable = CODE_READABLE_PCREL;
else if (strcmp (arg, "no") == 0)
mips_code_readable = CODE_READABLE_NO;
else
return false;
return true;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
default:
return true;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
}
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Implement OVERRIDE_OPTIONS. */
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
void
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_override_options (void)
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
int i, start, regno, mode;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Process flags as though we were generating non-MIPS16 code. */
mips_base_mips16 = TARGET_MIPS16;
target_flags &= ~MASK_MIPS16;
#ifdef SUBTARGET_OVERRIDE_OPTIONS
SUBTARGET_OVERRIDE_OPTIONS;
#endif
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Set the small data limit. */
mips_small_data_threshold = (g_switch_set
? g_switch_value
: MIPS_DEFAULT_GVALUE);
/* The following code determines the architecture and register size.
Similar code was added to GAS 2.14 (see tc-mips.c:md_after_parse_args()).
The GAS and GCC code should be kept in sync as much as possible. */
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
if (mips_arch_string != 0)
mips_set_architecture (mips_parse_cpu (mips_arch_string));
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (mips_isa_option_info != 0)
{
if (mips_arch_info == 0)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_set_architecture (mips_isa_option_info);
else if (mips_arch_info->isa != mips_isa_option_info->isa)
error ("%<-%s%> conflicts with the other architecture options, "
"which specify a %s processor",
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_isa_option_info->name,
mips_cpu_info_from_isa (mips_arch_info->isa)->name);
}
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
if (mips_arch_info == 0)
{
#ifdef MIPS_CPU_STRING_DEFAULT
mips_set_architecture (mips_parse_cpu (MIPS_CPU_STRING_DEFAULT));
#else
mips_set_architecture (mips_cpu_info_from_isa (MIPS_ISA_DEFAULT));
#endif
}
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
if (ABI_NEEDS_64BIT_REGS && !ISA_HAS_64BIT_REGS)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
error ("%<-march=%s%> is not compatible with the selected ABI",
mips_arch_info->name);
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Optimize for mips_arch, unless -mtune selects a different processor. */
if (mips_tune_string != 0)
mips_set_tune (mips_parse_cpu (mips_tune_string));
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
if (mips_tune_info == 0)
mips_set_tune (mips_arch_info);
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
if ((target_flags_explicit & MASK_64BIT) != 0)
{
/* The user specified the size of the integer registers. Make sure
it agrees with the ABI and ISA. */
if (TARGET_64BIT && !ISA_HAS_64BIT_REGS)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
error ("%<-mgp64%> used with a 32-bit processor");
else if (!TARGET_64BIT && ABI_NEEDS_64BIT_REGS)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
error ("%<-mgp32%> used with a 64-bit ABI");
else if (TARGET_64BIT && ABI_NEEDS_32BIT_REGS)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
error ("%<-mgp64%> used with a 32-bit ABI");
}
else
{
/* Infer the integer register size from the ABI and processor.
Restrict ourselves to 32-bit registers if that's all the
processor has, or if the ABI cannot handle 64-bit registers. */
if (ABI_NEEDS_32BIT_REGS || !ISA_HAS_64BIT_REGS)
target_flags &= ~MASK_64BIT;
else
target_flags |= MASK_64BIT;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
}
if ((target_flags_explicit & MASK_FLOAT64) != 0)
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TARGET_SINGLE_FLOAT && TARGET_FLOAT64)
error ("unsupported combination: %s", "-mfp64 -msingle-float");
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
else if (TARGET_64BIT && TARGET_DOUBLE_FLOAT && !TARGET_FLOAT64)
error ("unsupported combination: %s", "-mgp64 -mfp32 -mdouble-float");
else if (!TARGET_64BIT && TARGET_FLOAT64)
{
if (!ISA_HAS_MXHC1)
error ("%<-mgp32%> and %<-mfp64%> can only be combined if"
" the target supports the mfhc1 and mthc1 instructions");
else if (mips_abi != ABI_32)
error ("%<-mgp32%> and %<-mfp64%> can only be combined when using"
" the o32 ABI");
}
}
else
{
/* -msingle-float selects 32-bit float registers. Otherwise the
float registers should be the same size as the integer ones. */
if (TARGET_64BIT && TARGET_DOUBLE_FLOAT)
target_flags |= MASK_FLOAT64;
else
target_flags &= ~MASK_FLOAT64;
}
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* End of code shared with GAS. */
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* If no -mlong* option was given, infer it from the other options. */
if ((target_flags_explicit & MASK_LONG64) == 0)
{
if ((mips_abi == ABI_EABI && TARGET_64BIT) || mips_abi == ABI_64)
target_flags |= MASK_LONG64;
else
target_flags &= ~MASK_LONG64;
}
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
if (!TARGET_OLDABI)
flag_pcc_struct_return = 0;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Decide which rtx_costs structure to use. */
if (optimize_size)
mips_cost = &mips_rtx_cost_optimize_size;
else
mips_cost = &mips_rtx_cost_data[mips_tune];
/* If the user hasn't specified a branch cost, use the processor's
default. */
if (mips_branch_cost == 0)
mips_branch_cost = mips_cost->branch_cost;
/* If neither -mbranch-likely nor -mno-branch-likely was given
on the command line, set MASK_BRANCHLIKELY based on the target
architecture and tuning flags. Annulled delay slots are a
size win, so we only consider the processor-specific tuning
for !optimize_size. */
if ((target_flags_explicit & MASK_BRANCHLIKELY) == 0)
{
if (ISA_HAS_BRANCHLIKELY
&& (optimize_size
|| (mips_tune_info->tune_flags & PTF_AVOID_BRANCHLIKELY) == 0))
target_flags |= MASK_BRANCHLIKELY;
else
target_flags &= ~MASK_BRANCHLIKELY;
}
else if (TARGET_BRANCHLIKELY && !ISA_HAS_BRANCHLIKELY)
warning (0, "the %qs architecture does not support branch-likely"
" instructions", mips_arch_info->name);
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* The effect of -mabicalls isn't defined for the EABI. */
if (mips_abi == ABI_EABI && TARGET_ABICALLS)
{
error ("unsupported combination: %s", "-mabicalls -mabi=eabi");
target_flags &= ~MASK_ABICALLS;
}
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
if (TARGET_ABICALLS)
/* We need to set flag_pic for executables as well as DSOs
because we may reference symbols that are not defined in
the final executable. (MIPS does not use things like
copy relocs, for example.)
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
Also, there is a body of code that uses __PIC__ to distinguish
between -mabicalls and -mno-abicalls code. */
flag_pic = 1;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* -mvr4130-align is a "speed over size" optimization: it usually produces
faster code, but at the expense of more nops. Enable it at -O3 and
above. */
if (optimize > 2 && (target_flags_explicit & MASK_VR4130_ALIGN) == 0)
target_flags |= MASK_VR4130_ALIGN;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Prefer a call to memcpy over inline code when optimizing for size,
though see MOVE_RATIO in mips.h. */
if (optimize_size && (target_flags_explicit & MASK_MEMCPY) == 0)
target_flags |= MASK_MEMCPY;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* If we have a nonzero small-data limit, check that the -mgpopt
setting is consistent with the other target flags. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (mips_small_data_threshold > 0)
{
if (!TARGET_GPOPT)
{
if (!TARGET_EXPLICIT_RELOCS)
error ("%<-mno-gpopt%> needs %<-mexplicit-relocs%>");
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
TARGET_LOCAL_SDATA = false;
TARGET_EXTERN_SDATA = false;
}
else
{
if (TARGET_VXWORKS_RTP)
warning (0, "cannot use small-data accesses for %qs", "-mrtp");
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
if (TARGET_ABICALLS)
warning (0, "cannot use small-data accesses for %qs",
"-mabicalls");
}
}
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
#ifdef MIPS_TFMODE_FORMAT
REAL_MODE_FORMAT (TFmode) = &MIPS_TFMODE_FORMAT;
#endif
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Make sure that the user didn't turn off paired single support when
MIPS-3D support is requested. */
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
if (TARGET_MIPS3D
&& (target_flags_explicit & MASK_PAIRED_SINGLE_FLOAT)
&& !TARGET_PAIRED_SINGLE_FLOAT)
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
error ("%<-mips3d%> requires %<-mpaired-single%>");
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* If TARGET_MIPS3D, enable MASK_PAIRED_SINGLE_FLOAT. */
if (TARGET_MIPS3D)
target_flags |= MASK_PAIRED_SINGLE_FLOAT;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Make sure that when TARGET_PAIRED_SINGLE_FLOAT is true, TARGET_FLOAT64
and TARGET_HARD_FLOAT_ABI are both true. */
if (TARGET_PAIRED_SINGLE_FLOAT && !(TARGET_FLOAT64 && TARGET_HARD_FLOAT_ABI))
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
error ("%qs must be used with %qs",
TARGET_MIPS3D ? "-mips3d" : "-mpaired-single",
TARGET_HARD_FLOAT_ABI ? "-mfp64" : "-mhard-float");
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Make sure that the ISA supports TARGET_PAIRED_SINGLE_FLOAT when it is
enabled. */
invoke.texi (-mpaired-single): Don't say that the option requires 64-bit code. gcc/ * doc/invoke.texi (-mpaired-single): Don't say that the option requires 64-bit code. * config/mips/mips-protos.h (mips_modes_tieable_p): Declare. * config/mips/mips.h (ISA_HAS_PAIRED_SINGLE): New macro. (ISA_HAS_NMADD_NMSUB): Add a mode argument. Return true for V2SF if ISA_MIPS32R2. (MODES_TIEABLE_P): Use mips_modes_tieable_p. * config/mips/mips.c (mips_rtx_costs): Pass a mode argument to ISA_HAS_NMADD_NMSUB. (mips_split_doubleword_move): Handle V2SF. (mips_modes_tieable_p): New function. (override_options): Report a warning rather than an error when -mpaired-single is used on ISAs that don't support it; use ISA_HAS_PAIRED_SINGLE to check that case. * config/mips/mips.md (MOVE64): New mode iterator. Replace DI and DF move splitters with a single MOVE64 splitter, thereby adding a V2SF splitter too. (SPLITF): Add TARGET_DOUBLE_FLOAT conditions to DI and DF. Add a TARGET_FLOAT64 condition to TF. Add V2SF to the iterator. (HALFMODE): Add V2SF. (*nmadd<mode>, *nmadd<mode>_fastmath, *nmsub<mode>) (*nmsub<mode>_fastmath): Add a mode argument to ISA_HAS_NMADD_NMSUB. (movv2sf_hardfloat_64bit): Tweak ordering of conditions. (movv2sf_hardfloat_32bit): New pattern. (load_low<mode>, load_high<mode>, store_word<mode>): Remove TARGET_DOUBLE_FLOAT conditions. gcc/testsuite/ * gcc.dg/vect/vect.exp: Extend -mpaired-single handling to all MIPS targets. * g++.dg/vect/vect.exp: Likewise. * lib/fortran-torture.exp: Likewise. * gcc.target/mips/mips-ps-1.c: Use mpaired_single rather than mipsisa64*-*-* as the target selector. Remove -mips64, -mhard-float and -mgp64 from the options list. * gcc.target/mips/mips-ps-2.c: Likewise. * gcc.target/mips/mips-ps-3.c: Likewise. * gcc.target/mips/mips-ps-4.c: Likewise. * gcc.target/mips/mips-ps-6.c: Likewise. * gcc.target/mips/mips-ps-5.c: Remove -mhard-float from the options list. * gcc.target/mips/sb1-1.c: Likewise. * gcc.target/mips/mips-ps-type.c: Likewise. * gcc.target/mips/mips-ps-7.c: New test. * gcc.target/mips/mips-ps-type-2.c: Likewise. * gcc.target/mips/fpr-moves-6.c: Remove XFAIL. * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_fp and mips_gp instead of mips_fp64 and mips_gp64. Treat -mgp32 -mfp64 as forcing an ABI and an architecture. (is_gp32_flag, is_gp64_flag): Fold into... (dg-mips-options): ...here. Make -mpaired-single imply -mfp64, then -mfp64 imply -mhard-float. Apply register rules after the loop. Handle -march=mipsN like -mipsN. From-SVN: r129522
2007-10-21 11:07:13 +02:00
if (TARGET_PAIRED_SINGLE_FLOAT && !ISA_HAS_PAIRED_SINGLE)
warning (0, "the %qs architecture does not support paired-single"
" instructions", mips_arch_info->name);
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* If TARGET_DSPR2, enable MASK_DSP. */
if (TARGET_DSPR2)
target_flags |= MASK_DSP;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
mips_init_print_operand_punct ();
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Set up array to map GCC register number to debug register number.
Ignore the special purpose register numbers. */
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
mips_dbx_regno[i] = INVALID_REGNUM;
if (GP_REG_P (i) || FP_REG_P (i) || ALL_COP_REG_P (i))
mips_dwarf_regno[i] = i;
else
mips_dwarf_regno[i] = INVALID_REGNUM;
}
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
start = GP_DBX_FIRST - GP_REG_FIRST;
for (i = GP_REG_FIRST; i <= GP_REG_LAST; i++)
mips_dbx_regno[i] = i + start;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
start = FP_DBX_FIRST - FP_REG_FIRST;
for (i = FP_REG_FIRST; i <= FP_REG_LAST; i++)
mips_dbx_regno[i] = i + start;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Accumulator debug registers use big-endian ordering. */
mips_dbx_regno[HI_REGNUM] = MD_DBX_FIRST + 0;
mips_dbx_regno[LO_REGNUM] = MD_DBX_FIRST + 1;
mips_dwarf_regno[HI_REGNUM] = MD_REG_FIRST + 0;
mips_dwarf_regno[LO_REGNUM] = MD_REG_FIRST + 1;
for (i = DSP_ACC_REG_FIRST; i <= DSP_ACC_REG_LAST; i += 2)
{
mips_dwarf_regno[i + TARGET_LITTLE_ENDIAN] = i;
mips_dwarf_regno[i + TARGET_BIG_ENDIAN] = i + 1;
}
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Set up mips_hard_regno_mode_ok. */
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
mips_hard_regno_mode_ok[(int)mode][regno]
= mips_hard_regno_mode_ok_p (regno, mode);
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
/* Function to allocate machine-dependent function status. */
init_machine_status = &mips_init_machine_status;
/* Default to working around R4000 errata only if the processor
was selected explicitly. */
if ((target_flags_explicit & MASK_FIX_R4000) == 0
&& mips_matching_cpu_name_p (mips_arch_info->name, "r4000"))
target_flags |= MASK_FIX_R4000;
/* Default to working around R4400 errata only if the processor
was selected explicitly. */
if ((target_flags_explicit & MASK_FIX_R4400) == 0
&& mips_matching_cpu_name_p (mips_arch_info->name, "r4400"))
target_flags |= MASK_FIX_R4400;
/* Save base state of options. */
mips_base_target_flags = target_flags;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
mips_base_delayed_branch = flag_delayed_branch;
mips_base_schedule_insns = flag_schedule_insns;
mips_base_reorder_blocks_and_partition = flag_reorder_blocks_and_partition;
mips_base_move_loop_invariants = flag_move_loop_invariants;
mips_base_align_loops = align_loops;
mips_base_align_jumps = align_jumps;
mips_base_align_functions = align_functions;
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
/* Now select the ISA mode.
Do all CPP-sensitive stuff in non-MIPS16 mode; we'll switch to
MIPS16 mode afterwards if need be. */
mips_set_mips16_mode (false);
/* We call dbr_schedule from within mips_reorg. */
flag_delayed_branch = 0;
}
/* Swap the register information for registers I and I + 1, which
currently have the wrong endianness. Note that the registers'
fixedness and call-clobberedness might have been set on the
command line. */
static void
mips_swap_registers (unsigned int i)
{
int tmpi;
const char *tmps;
#define SWAP_INT(X, Y) (tmpi = (X), (X) = (Y), (Y) = tmpi)
#define SWAP_STRING(X, Y) (tmps = (X), (X) = (Y), (Y) = tmps)
SWAP_INT (fixed_regs[i], fixed_regs[i + 1]);
SWAP_INT (call_used_regs[i], call_used_regs[i + 1]);
SWAP_INT (call_really_used_regs[i], call_really_used_regs[i + 1]);
SWAP_STRING (reg_names[i], reg_names[i + 1]);
#undef SWAP_STRING
#undef SWAP_INT
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
}
/* Implement CONDITIONAL_REGISTER_USAGE. */
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
void
mips_conditional_register_usage (void)
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
{
if (!ISA_HAS_DSP)
{
int regno;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
for (regno = DSP_ACC_REG_FIRST; regno <= DSP_ACC_REG_LAST; regno++)
fixed_regs[regno] = call_used_regs[regno] = 1;
}
if (!TARGET_HARD_FLOAT)
{
int regno;
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
for (regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++)
fixed_regs[regno] = call_used_regs[regno] = 1;
for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++)
fixed_regs[regno] = call_used_regs[regno] = 1;
}
else if (! ISA_HAS_8CC)
{
int regno;
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* We only have a single condition-code register. We implement
this by fixing all the condition-code registers and generating
RTL that refers directly to ST_REG_FIRST. */
for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++)
fixed_regs[regno] = call_used_regs[regno] = 1;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* In MIPS16 mode, we permit the $t temporary registers to be used
for reload. We prohibit the unused $s registers, since they
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
are call-saved, and saving them via a MIPS16 register would
probably waste more time than just reloading the value. */
if (TARGET_MIPS16)
{
fixed_regs[18] = call_used_regs[18] = 1;
fixed_regs[19] = call_used_regs[19] = 1;
fixed_regs[20] = call_used_regs[20] = 1;
fixed_regs[21] = call_used_regs[21] = 1;
fixed_regs[22] = call_used_regs[22] = 1;
fixed_regs[23] = call_used_regs[23] = 1;
fixed_regs[26] = call_used_regs[26] = 1;
fixed_regs[27] = call_used_regs[27] = 1;
fixed_regs[30] = call_used_regs[30] = 1;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* $f20-$f23 are call-clobbered for n64. */
if (mips_abi == ABI_64)
{
int regno;
for (regno = FP_REG_FIRST + 20; regno < FP_REG_FIRST + 24; regno++)
call_really_used_regs[regno] = call_used_regs[regno] = 1;
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* Odd registers in the range $f21-$f31 (inclusive) are call-clobbered
for n32. */
if (mips_abi == ABI_N32)
{
int regno;
for (regno = FP_REG_FIRST + 21; regno <= FP_REG_FIRST + 31; regno+=2)
call_really_used_regs[regno] = call_used_regs[regno] = 1;
}
/* Make sure that double-register accumulator values are correctly
ordered for the current endianness. */
if (TARGET_LITTLE_ENDIAN)
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
unsigned int regno;
mips_swap_registers (MD_REG_FIRST);
for (regno = DSP_ACC_REG_FIRST; regno <= DSP_ACC_REG_LAST; regno += 2)
mips_swap_registers (regno);
}
}
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
mips-modes.def: Add V8QI, V4HI and V2SI modes. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes. * config/mips/mips-protos.h (mips_expand_vector_init): New. * config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F builtins. * config/mips/mips.c (mips_split_doubleword_move): Handle new modes. (mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson. (mips_vector_mode_supported_p): Add V2SImode, V4HImode and V8QImode cases. (LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New. (CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb, (CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw, (CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb, (CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb) (CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb) (CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub) (CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub) (CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh) (CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw) (CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb) (CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb) (CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb) (CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw) (CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh) (CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New. (mips_builtins): Add Loongson builtins. (mips_loongson_2ef_bdesc): New. (mips_bdesc_arrays): Add mips_loongson_2ef_bdesc. (mips_builtin_vector_type): Handle unsigned versions of vector modes. (MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI) (MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI): New. (mips_expand_vector_init): New. * config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New. (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev if appropriate. * config/mips/mips.md: Add unspec numbers for Loongson builtins. Include loongson.md. (MOVE64): Include Loongson vector modes. (SPLITF): Include Loongson vector modes. (HALFMODE): Handle Loongson vector modes. * config/mips/loongson.md: New. * config/mips/loongson.h: New. * config.gcc: Add loongson.h header for mips*-*-* targets. * doc/extend.texi (MIPS Loongson Built-in Functions): New. 2008-06-15 Mark Shinwell <shinwell@codesourcery.com> * lib/target-supports.exp (check_effective_target_mips_loongson): New. * gcc.target/mips/loongson-simd.c: New. Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r136800
2008-06-15 08:29:06 +02:00
/* Initialize vector TARGET to VALS. */
void
mips_expand_vector_init (rtx target, rtx vals)
{
enum machine_mode mode;
enum machine_mode inner;
unsigned int i, n_elts;
rtx mem;
mode = GET_MODE (target);
inner = GET_MODE_INNER (mode);
n_elts = GET_MODE_NUNITS (mode);
gcc_assert (VECTOR_MODE_P (mode));
mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
for (i = 0; i < n_elts; i++)
emit_move_insn (adjust_address_nv (mem, inner, i * GET_MODE_SIZE (inner)),
XVECEXP (vals, 0, i));
emit_move_insn (target, mem);
}
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
/* When generating MIPS16 code, we want to allocate $24 (T_REG) before
other registers for instructions for which it is possible. This
encourages the compiler to use CMP in cases where an XOR would
require some register shuffling. */
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
void
mips_order_regs_for_local_alloc (void)
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
{
mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". gcc/ * config/mips/mips-protos.h (mips_regno_mode_ok_for_base_p): Give the STRICT_P argument type "bool" rather than "int". (mips_legitimate_address_p): Likewise. (fp_register_operand, lo_operand): Delete. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. (mips_expand_call): Give the SIBCALL_P argument type "bool" rather than "int". (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this and remove the libname argument. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (override_options): Rename to... (mips_override_options): ...this. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. (mips_output_ascii): Remove the PREFIX argument. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_function_value): Remove the FUNC argument. Use "rtx" instead of "struct rtx_def *". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (build_mips16_call_stub): Delete. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (mips_use_ins_ext_p): Give the second and third arguments type "HOST_WIDE_INT" rather than "rtx". * config/mips/mips.h: Update after the above changes. Tweak comments and formatting. (SECONDARY_INPUT_RELOAD_CLASS): Pass a boolean IN_P argument. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_section_threshold, sym_lineno, set_noat, mips_branch_likely) (mips_cpu_info_table): Delete. * config/mips/mips.md: Update after the above changes. Tweak some formatting. * config/mips/mips-ps-3d.md: Likewise. * config/mips/mips.c: Tweak comments and formatting. Use NULL-like macros rather than 0 in various places. (mips_section_threshold): Rename to... (mips_small_data_threshold): ...this and give it an unsigned type. (num_source_filenames): Remove explicit initialization. (sdb_label_count): Likewise. (sym_lineno): Delete. (set_noat): Make static. (mips_branch_likely): Likewise, and give it type "bool". (mips_isa_info): Rename to... (mips_isa_option_info): ...this. (mips_flag_delayed_branch): Rename to... (mips_base_delayed_branch): ...this. (mips_split_addresses): Delete. (mips_print_operand_punct, mips_hard_regno_mode_ok): Change the element type from "char" to "bool". (mips_regno_to_class): Add an explicit array size. (mips16_flipper): Change from type "int" to type "bool". (mips_comp_type_attributes): Remove redundant FUNCTION_TYPE check. (mips_tls_operand_p): Rename to... (mips_tls_symbol_p): ...this. (mips_global_symbol_p): Remove redundant "const". (mips_offset_within_alignment_p): Simplify. (mips_regno_mode_ok_for_base_p): Change the name of the last argument to STRICT_P and give it type bool. (mips_valid_base_register_p): Likewise. (mips_classify_address): Likewise. (mips_legitimate_address_p): Likewise. (mips16_unextended_reference_p): Take the offset as an "unsigned HOST_WIDE_INT" rather than an "rtx". Simplify. (mips_const_insns): Use IN_RANGE. (mips_force_temporary): Remove an unnecessary copy_rtx. (mips16_gp_pseudo_reg): Simplify. (mips_split_symbol): Remove an unnecessary copy_rtx. (mips_legitimize_tls_address): Only create registers if we need them. (mips_legitimize_address): Use mips_split_plus. (mips_move_integer): Swap DEST and TEMP arguments. Rename local variable COST to NUM_OPS. (mips_legitimize_move): Use gen_lowpart. (mips_rewrite_small_data): Rename the OP parameter to PATTERN. (m16_check_op): Use IN_RANGE. (mips_subword): Give the HIGH_P argument type "bool" rather than "int". (mips_split_doubleword_move): Pass booleans to mips_subword. (mips_output_move): Store the mode in a local variable. Explicitly assert that this function does not deal with MFLO and MFHI. Use SMALL_OPERAND_UNSIGNED. Make order of cases more consistent. (mips_relational_operand_ok_p): Rename to... (mips_int_order_operand_ok_p): ...this. (mips_canonicalize_comparison): Rename to... (mips_canonicalize_int_order_test): ...this. (mips_emit_int_relational): Rename to... (mips_emit_int_order_test): ...this. Store the mode in a local variable. (mips_reverse_fp_cond_p): Rename to... (mips_reversed_fp_cond): ...this. (mips_emit_compare): Make the order of the statements more consistent. (mips_emit_scc): Rename to... (mips_expand_scc): ...this. (gen_conditional_branch): Rename to... (mips_expand_conditional_branch): ...this. (gen_conditional_move): Rename to... (mips_expand_conditional_move): ...this. Build the condition separately from the main pattern. (mips_gen_conditional_trap): Rename to... (mips_expand_conditional_trap): ...this and take an rtx code instead of an operands array. Simplify. (init_cumulative_args): Rename to... (mips_init_cumulative_args): ...this. Use memset rather than a copy from a zeroed static. Use prototype_p and stdarg_p. (mips_arg_info): Rename to... (mips_get_arg_info): ...this and put the INFO argument first. (function_arg): Rename to... (mips_function_arg): ...this and use "rtx" instead of "struct rtx_def *". Only split structures into chunks if TARGET_HARD_FLOAT, rather than checking !TARGET_SOFT_FLOAT on a chunk-by-chunk basis. Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. Rename local variable REG to REGNO and make it unsigned. (function_arg_advance): Rename to... (mips_function_arg_advance): ...this. (function_arg_boundary): Rename to... (mips_function_arg_boundary): ...this. (mips_pad_arg_upward): Use SCALAR_INT_MODE_P instead of a comparison with MODE_INT. (mips_fpr_return_fields): Use SCALAR_FLOAT_TYPE_P instead of a comparison with REAL_TYPE. (mips_function_value): Remove the FUNC argument. Rename local variable UNSIGNEDP to UNSIGNED_P. (mips_return_in_memory): Use IN_RANGE. (mips_setup_incoming_varargs): Pass a boolean rather than an int to FUNCTION_ARG_ADVANCE. (mips_gimplify_va_arg_expr): Rename local variable INDIRECT to INDIRECT_P. Remove a redundant mips_abi check. Only calculate SIZE and RSIZE if needed. (mips16_stub): Rename FPRET to FP_RET_P and give it type "bool" rather than "int". (build_mips16_function_stub): Rename to... (mips16_build_function_stub): ...this. (build_mips16_call_stub): Rename to... (mips16_build_call_stub): ...this. Make static, and return a "bool" rather than an "int". Rename the ARG_SIZE argument to ARGS_SIZE. Rename the local variable FPRET to FP_RET_P and give it type "bool". Use "jr" rather than "j". Use XNEW. Simplify. (mips_load_call_address): Give the SIBCALL_P argument type "bool" rather than "int". (mips_expand_call): Likewise. Assert that MIPS16 calls via stubs are not sibling ones. (mips_emit_fcc_reload): Rename to... (mips_expand_fcc_reload): ...this. (mips_get_unaligned_mem): Give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_expand_unaligned_load): Rename to... (mips_expand_ext_as_unaligned_load): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". Remove redundant SUBREG_BYTE check. (mips_expand_unaligned_store): Rename to... (mips_expand_ins_as_unaligned_store): ...this and give the WIDTH and BITPOS arguments type "HOST_WIDE_INT". (mips_use_ins_ext_p): Rename second and third arguments to WIDTH and BITPOS and give them type "HOST_WIDE_INT" rather than "rtx". Use IN_RANGE. (mips_init_split_addresses): Replace with... (mips_split_addresses_p): ...this new function. (mips_init_relocs): Check mips_split_addresses_p () rather than mips_split_addresses. Always initialize mips_split_p with booleans. (print_operand_reloc): Rename to... (mips_print_operand_reloc): ...this. Use a gcc_assert rather than a fatal_error. (print_operand): Rename to... (mips_print_operand): ...this. (print_operand_address): Rename to... (mips_print_operand_address): ...this. Use GP_REG_FIRST. (mips_in_small_data_p): Simplify. (mips_output_ascii): Remove the PREFIX argument and "register" keywords. Use the STRING parameter directly and cast to "unsigned char". (mips16e_collect_argument_save_p): Use IN_RANGE. (mips_function_has_gp_insn): Simplify. (mips_set_return_address): Use BITSET_P. (mips_restore_gp): Use a separate statement to pick the base register. (mips_output_function_prologue): Use a local FRAME variable. (mips_save_reg): Pass booleans to mips_subword. (mips_expand_prologue): Use a local FRAME variable. Use cprestore_size to detect when .cprestore is needed. (mips_restore_reg): Use GP_REG_FIRST. (mips_expand_epilogue): Give the SIBCALL_P argument type "bool" rather than "int". Use local FRAME and REGNO variables. (mips_can_use_return_insn): Return a "bool" rather than an "int". (mips_secondary_reload_class): Give the IN_P argument type "bool" rather than "int". (mips_linked_madd_p): Rename arguments to OUT_INSN and IN_INSN. (mips_store_data_bypass_p): Return a "bool" rather than an "int". (vr4130_swap_insns_p): Rename local variables to DEP1_P and DEP2_P. (mips_74k_agen_init): Assume INSN satisfies USEFUL_INSN_P. (mips_variable_issue): Do nothing unless INSN satisfies USEFUL_INSN_P. (builtin_description): Rename to... (mips_builtin_description): ...this. (mips_bdesc): Rename to... (mips_ps_bdesc): ...this. (sb1_bdesc): Rename to... (mips_sb1_bdesc): ...this. (dsp_bdesc): Rename to... (mips_dsp_bdesc): ...this. (dsp_32only_bdesc): Rename to... (mips_dsp_32only_bdesc): ...this. (bdesc_map): Rename to... (mips_bdesc_map): ...this. (bdesc_arrays): Rename to... (mips_bdesc_arrays): ...this. (mips_prepare_builtin_arg): Rename OP to OPNO and ARGNUM to ARGNO. Tweak error message. (mips_expand_builtin_direct): Rename HAS_TARGET to HAS_TARGET_P. Rename local variables I and J to OPNO and ARGNO respectively. Assert that the number of arguments is no more than the number of input operands. (mips_expand_builtin_compare): Use an array of arguments rather than an array of operands. Assert that the number of operands is as expected. (add_constant): Rename to... (mips16_add_constant): ...this. Use XNEW. (dump_constants_1): Rename to... (mips16_emit_constants_1): ...this. Use ALL_SCALAR_FIXED_POINT_MODE_P. (dump_constants): Rename to... (mips16_emit_constants): ...this. (mips_sim_wait_reg, mips_sim_record_set): Use END_REGNO. (mips_set_mips16_mode): Don't call mips_init_split_addresses. Assign mips16_p to was_mips16_p. (mips_parse_cpu): Tweak warning message. (override_options): Rename to... (mips_override_options): ...this. Move the mips_cost initialization out of the "shared with GAS" block. Quote option names in error messages. (mips_conditional_register_usage): Make local variable REGNO unsigned. (mips_order_regs_for_local_alloc): Remove register keyword. From-SVN: r129532
2007-10-21 13:19:40 +02:00
int i;
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
reg_alloc_order[i] = i;
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
if (TARGET_MIPS16)
{
/* It really doesn't matter where we put register 0, since it is
a fixed register anyhow. */
reg_alloc_order[0] = 24;
reg_alloc_order[24] = 0;
}
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
}
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
#undef TARGET_ASM_ALIGNED_DI_OP
#define TARGET_ASM_ALIGNED_DI_OP "\t.dword\t"
mips-protos.h (mips_output_conditional_branch): Change interface. * config/mips/mips-protos.h (mips_output_conditional_branch): Change interface. (mips_output_order_conditional_branch): Declare. * config/mips/mips.h (MIPS_BRANCH): New macro. * config/mips/mips.c (gen_conditional_branch): Use VOIDmode for the comparison. Use gen_condjump. (mips_output_conditional_branch): Rework interface to take the asm templates for a direct branch and the inverse of a direct branch. (mips_output_order_conditional_branch): New function. (mips_builtin_branch_and_move): New function. (mips_expand_builtin_compare): Use it. Use VOIDmode for the branch condition. Use gen_single_cc as the condition for __builtin_mips_upper_* or __builtin_mips_lower_*. (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. Use VOIDmode for the branch condition. * config/mips/predicates.md (order_operator): New predicate. * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. (branch_fp): Rename to... (*branch_fp): ...this. Remove mode from comparison operator. Use new mips_output_conditional_branch interface. (branch_fp_inverted): Rename to... (*branch_fp_inverted): ...this and update as for *branch_fp. (*branch_zero<mode>): Rename to... (*branch_order<mode>): ...this. Remove mode from comparison operator. Use mips_output_order_conditional_branch. Only accept ordered comparisons. (*branch_zero<mode>_inverted): Rename to... (*branch_order<mode>_inverted): ...this and update as for *branch_order<mode>. (*branch_equality<mode>): Accept zero as the second operand to the equality operator. Use the new mips_output_conditional_branch interface. (*branch_equality<mode>_inverted): Likewise. (condjump): New expander. * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison operator. * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. (bc1any2t, bc1any2f): Likewise. (single_cc): New expander. (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. From-SVN: r111909
2006-03-09 22:03:17 +01:00
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE mips_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE mips_output_function_epilogue
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION mips_select_rtx_section
#undef TARGET_ASM_FUNCTION_RODATA_SECTION
#define TARGET_ASM_FUNCTION_RODATA_SECTION mips_function_rodata_section
#undef TARGET_SCHED_INIT
#define TARGET_SCHED_INIT mips_sched_init
#undef TARGET_SCHED_REORDER
#define TARGET_SCHED_REORDER mips_sched_reorder
#undef TARGET_SCHED_REORDER2
#define TARGET_SCHED_REORDER2 mips_sched_reorder
#undef TARGET_SCHED_VARIABLE_ISSUE
#define TARGET_SCHED_VARIABLE_ISSUE mips_variable_issue
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST mips_adjust_cost
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE mips_issue_rate
loongson2ef.md: New file. * config/mips/loongson2ef.md: New file. * config/mips/mips.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN) (UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): New constants. (define_attr "cpu"): Rename loongson2e and loongson2f to loongson_2e and loongson_2f. (loongson2ef.md): New include. * config/mips/loongson.md (vec_pack_ssat_<mode>, vec_pack_usat_<mode>) (add<mode>3, paddd, ssadd<mode>3, usadd<mode>3) (loongson_and_not_<mode>, loongson_average_<mode>, loongson_eq_<mode>) (loongson_gt_<mode>, loongson_extract_halfword) (loongson_insert_halfword_0, loongson_insert_halfword_2) (loongson_insert_halfword_3, loongson_mult_add, smax<mode>3) (umax<mode>3, smin<mode>3, umin<mode>3, loongson_move_byte_mask) (umul<mode>3_highpart, smul<mode>3_highpart, loongson_smul_lowpart) (loongson_umul_word, loongson_pasubub, reduc_uplus_<mode>) (loongson_psadbh, loongson_pshufh, loongson_psll<mode>) (loongson_psra<mode>, loongson_psrl<mode>, sub<mode>3, psubd) (sssub<mode>3, ussub<mode>3, vec_interleave_high<mode>) (vec_interleave_low<mode>): Define type attribute. * config/mips/mips.c (mips_ls2): New static variable. (mips_issue_rate): Update to handle tuning for Loongson 2E/2F. (mips_ls2_init_dfa_post_cycle_insn, mips_init_dfa_post_cycle_insn) (sched_ls2_dfa_post_advance_cycle, mips_dfa_post_advance_cycle): Implement target scheduling hooks. (mips_multipass_dfa_lookahead): Update to handle tuning for Loongson 2E/2F. (mips_sched_init): Initialize data for Loongson scheduling. (mips_ls2_variable_issue): New static function. (mips_variable_issue): Update to handle tuning for Loongson 2E/2F. Add sanity check. (TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN) (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Override target hooks. * config/mips/mips.h (TUNE_LOONGSON_2EF): New macros. (ISA_HAS_XFER_DELAY, ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): Handle ST Loongson 2E/2F cores. (CPU_UNITS_QUERY): Define macro to enable querying of DFA units. From-SVN: r136805
2008-06-15 12:03:07 +02:00
#undef TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN
#define TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN mips_init_dfa_post_cycle_insn
#undef TARGET_SCHED_DFA_POST_ADVANCE_CYCLE
#define TARGET_SCHED_DFA_POST_ADVANCE_CYCLE mips_dfa_post_advance_cycle
#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
mips_multipass_dfa_lookahead
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS \
(TARGET_DEFAULT \
| TARGET_CPU_DEFAULT \
| TARGET_ENDIAN_DEFAULT \
| TARGET_FP_EXCEPTIONS_DEFAULT \
| MASK_CHECK_ZERO_DIV \
| MASK_FUSED_MADD)
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION mips_handle_option
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
#undef TARGET_FUNCTION_OK_FOR_SIBCALL
#define TARGET_FUNCTION_OK_FOR_SIBCALL mips_function_ok_for_sibcall
#undef TARGET_INSERT_ATTRIBUTES
#define TARGET_INSERT_ATTRIBUTES mips_insert_attributes
#undef TARGET_MERGE_DECL_ATTRIBUTES
#define TARGET_MERGE_DECL_ATTRIBUTES mips_merge_decl_attributes
#undef TARGET_SET_CURRENT_FUNCTION
#define TARGET_SET_CURRENT_FUNCTION mips_set_current_function
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
#undef TARGET_VALID_POINTER_MODE
#define TARGET_VALID_POINTER_MODE mips_valid_pointer_mode
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS mips_rtx_costs
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST mips_address_cost
mips-modes.def (V2SF, CCV2, CCV4): New modes. 2004-08-29 Chao-ying Fu <fu@mips.com> James E Wilson <wilson@specifixinc.com> * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 8 byte size and alignment. Give CCV4 16 byte size and alignment. * config/mips/mips-ps-3d.md: New file. * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. (mips_output_move): Emit "mov.ps" for V2SFmode. (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and MODE_VECTOR_FLOAT. (override_options): Check if TARGET_MIPS3D and there was an explicit !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, and allow CCV2 and CCV4 to occupy two and four CC registers. (print_fcc_operand): New function. (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify %Z to call print_fcc_operand. (mips_function_value): Handle MODE_VECTOR_FLOAT. (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. (mips_vector_mode_supported_p): New function. (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. (builtin_description): New struct. (mips_bdesc): New array of struct builtin_description. (mips_expand_builtin, mips_init_builtins, mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New functions. * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", "-mips3d", and "-mno-mips3d". (ASM_SPEC): Map -mips3d to -mips3d in gas. (EXTRA_CONSTRAINT_Y): New macro. (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new multi-letter constraint 'Y'. (CONSTRAINT_LEN): New macro. (enum mips_builtins): New for MIPS builtin functions. (enum mips_function_type): New for the types of MIPS builtin functions. (enum mips_cmp_choice): New for the MIPS comparison builtin functions. * config/mips/mips.md: New constants for paired single and MIPS-3D instructions. Include the new mips-ps-3d.md file. (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, movv2sf_hardfloat_64bit): New named patterns. (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, sdxc1_v2sf_di): New unnamed patterns. * config/mips/predicates.md (const_0_operand, const_1_operand): Add const_vector support. (const_0_or_1_operand): New predicate. * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. Co-Authored-By: James E Wilson <wilson@specifixinc.com> From-SVN: r86713
2004-08-29 11:19:34 +02:00
#undef TARGET_IN_SMALL_DATA_P
#define TARGET_IN_SMALL_DATA_P mips_in_small_data_p
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mips_reorg
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
#undef TARGET_ASM_FILE_START
#define TARGET_ASM_FILE_START mips_file_start
#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS mips_init_libfuncs
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST mips_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 mips_va_start
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR mips_gimplify_va_arg_expr
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
#undef TARGET_PROMOTE_FUNCTION_ARGS
#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_const_tree_true
#undef TARGET_PROMOTE_FUNCTION_RETURN
#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_const_tree_true
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
mips-dsp.md: New file. * config/mips/mips-dsp.md: New file. * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. * config/mips/mips.c (mips_function_type): Add types for DSP builtin functions. (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_expand_builtin_direct): Add one parameter to indicate that builtin functions need to return a value. (mips_expand_builtin_bposge): New for expanding "bposge" builtin functions. (mips_regno_to_class): Add classes for 12 new DSP registers. (mips_subword): Change to check four HI registers. (mips_output_move): Output move to and from 6 new DSP accumulators. (override_options): Make sure -mdsp and -mips16 are not used together. Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators for machine modes. (mips_conditional_register_usage): Disable 6 new DSP accumulators when !TARGET_DSP. (print_operand): Add 'q' for printing DSP accumulators. (mips_cannot_change_mode_class): Check ACC_REGS. (mips_secondary_reload_class): Check ACC_REGS. (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. (mips_register_move_cost): Check ACC_REGS. (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) (CODE_FOR_mips_subu_qb): New code-aliasing macros. (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. (dsp_bdesc): New array. (bdesc_arrays): Add DSP builtin function table. (mips_prepare_builtin_arg): Check predicate again after copy_to_mode_reg. (mips_expand_builtin): Add one more parameter to mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and MIPS_BUILTIN_BPOSGE32. (mips_init_builtins): Initialize new function types. (mips_expand_builtin_direct): Check if builtin functions need to return a value and pass operands properly. (mips_expand_builtin_bposge): New function. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. (ASM_SPEC): Map -mdsp to -mdsp in GAS. (FIRST_PSEUDO_REGISTER): Increase to 188. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update for 12 new DSP registers. (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. (reg_class): Add DSP_ACC_REGS and ACC_REGS. (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. (REG_ALLOC_ORDER): Update for 12 new DSP registers. (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. (UIMM6_OPERAND, IMM10_OPERAND): New macros. (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. (REGISTER_NAMES): Add names for 12 new DSP registers. * config/mips/mips.md: Include mips-dsp.md. (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) (UNSPEC_RDDSP): New constants. (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an A<-d alternative. * config/mips/mips.opt (-mdsp): New option. * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) (reg_imm10_operand): New predicates. * doc/extend.texi (MIPS DSP Built-in Functions): New section. * doc/invoke.texi (-mdsp): Document new option. From-SVN: r102307
2005-07-23 10:36:54 +02:00
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY mips_return_in_memory
#undef TARGET_RETURN_IN_MSB
#define TARGET_RETURN_IN_MSB mips_return_in_msb
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK mips_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_const_tree_hwi_hwi_const_tree_true
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS mips_setup_incoming_varargs
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING mips_strict_argument_naming
#undef TARGET_MUST_PASS_IN_STACK
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE mips_pass_by_reference
#undef TARGET_CALLEE_COPIES
#define TARGET_CALLEE_COPIES mips_callee_copies
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES mips_arg_partial_bytes
#undef TARGET_MODE_REP_EXTENDED
#define TARGET_MODE_REP_EXTENDED mips_mode_rep_extended
re PR rtl-optimization/24762 ([killloop-branch] code motion of non-invariant expressions with hard registers.) 2006-01-27 Daniel Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> PR rtl-optimization/24762 * doc/tm.texi: Added TARGET_EXTRA_LIVE_ON_ENTRY. * targhooks.c (hook_void_bitmap): New hook prototype. * targhoohs.h (hook_void_bitmap): Ditto. * bitmap.h (bitmap_head_def): Moved to coretypes.h. * coretypes.h (bitmap_head_def): Moved from bitmap.h. * target.h (live_on_entry): New function pointer. * df-scan.c (df_all_hard_regs): Removed. (df_scan_dump, df_hard_reg_init): Removed df_all_hard_regs. (df_scan_free_internal): Added df->entry_block_defs. (df_scan_alloc): Ditto. (df_scan_dump): Ditto. (df_uses_record): Plumbed flag field properly thru calls. Record EH_RETURN_DATA_REGNO in eh blocks unconditionally. This part fixes PR24762. (df_bb_refs_record): Added code to make the frame and arg pointers live in EH blocks. (df_refs_record): Added call to df_record_entry_block_defs. (df_record_entry_block_defs): New function. * df-core.c: Added comments to describe new artifical defs. * df.h (DF_REF_DIES_AFTER_THIS_USE): New flag in enum df_ref_flags. (entry_block_defs): New field in struct df. (df_all_hard_regs): Deleted. * target-def.h: Added TARGET_EXTRA_LIVE_ON_ENTRY. * df-problems.c (df_ru_bb_local_compute_process_def): Added code to handle artifical defs in the entry to a function. (df_ru_bb_local_compute): Ditto. (df_rd_bb_local_compute_process_def): Ditto. (df_rd_bb_local_compute): Ditto. (df_lr_bb_local_compute): Ditto. (df_ur_bb_local_compute): Ditto. (df_urec_bb_local_compute): Ditto. (df_chain_create_bb): Ditto. (df_ur_local_finalize): Removed entry. (df_urec_init): Ditto. (df_urec_local_finalize): Ditto. (df_ri_bb_compute): Added detection of last use of pseudos. * Makefile.in (df-scan.o): Updated dependencies. * config/mips/mips-protos.h (mips_set_live_on_entry): Added. * config/mips/mips.c (mips_set_live_on_entry): Added. * config/mips/mips.c (TARGET_EXTRA_LIVE_ON_ENTRY): Added value for target hook. * dce.c (marked_insn_p): Added code to handle artifical defs. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r110312
2006-01-27 23:23:32 +01:00
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P mips_vector_mode_supported_p
re PR rtl-optimization/24762 ([killloop-branch] code motion of non-invariant expressions with hard registers.) 2006-01-27 Daniel Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> PR rtl-optimization/24762 * doc/tm.texi: Added TARGET_EXTRA_LIVE_ON_ENTRY. * targhooks.c (hook_void_bitmap): New hook prototype. * targhoohs.h (hook_void_bitmap): Ditto. * bitmap.h (bitmap_head_def): Moved to coretypes.h. * coretypes.h (bitmap_head_def): Moved from bitmap.h. * target.h (live_on_entry): New function pointer. * df-scan.c (df_all_hard_regs): Removed. (df_scan_dump, df_hard_reg_init): Removed df_all_hard_regs. (df_scan_free_internal): Added df->entry_block_defs. (df_scan_alloc): Ditto. (df_scan_dump): Ditto. (df_uses_record): Plumbed flag field properly thru calls. Record EH_RETURN_DATA_REGNO in eh blocks unconditionally. This part fixes PR24762. (df_bb_refs_record): Added code to make the frame and arg pointers live in EH blocks. (df_refs_record): Added call to df_record_entry_block_defs. (df_record_entry_block_defs): New function. * df-core.c: Added comments to describe new artifical defs. * df.h (DF_REF_DIES_AFTER_THIS_USE): New flag in enum df_ref_flags. (entry_block_defs): New field in struct df. (df_all_hard_regs): Deleted. * target-def.h: Added TARGET_EXTRA_LIVE_ON_ENTRY. * df-problems.c (df_ru_bb_local_compute_process_def): Added code to handle artifical defs in the entry to a function. (df_ru_bb_local_compute): Ditto. (df_rd_bb_local_compute_process_def): Ditto. (df_rd_bb_local_compute): Ditto. (df_lr_bb_local_compute): Ditto. (df_ur_bb_local_compute): Ditto. (df_urec_bb_local_compute): Ditto. (df_chain_create_bb): Ditto. (df_ur_local_finalize): Removed entry. (df_urec_init): Ditto. (df_urec_local_finalize): Ditto. (df_ri_bb_compute): Added detection of last use of pseudos. * Makefile.in (df-scan.o): Updated dependencies. * config/mips/mips-protos.h (mips_set_live_on_entry): Added. * config/mips/mips.c (mips_set_live_on_entry): Added. * config/mips/mips.c (TARGET_EXTRA_LIVE_ON_ENTRY): Added value for target hook. * dce.c (marked_insn_p): Added code to handle artifical defs. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r110312
2006-01-27 23:23:32 +01:00
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P mips_scalar_mode_supported_p
re PR rtl-optimization/24762 ([killloop-branch] code motion of non-invariant expressions with hard registers.) 2006-01-27 Daniel Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> PR rtl-optimization/24762 * doc/tm.texi: Added TARGET_EXTRA_LIVE_ON_ENTRY. * targhooks.c (hook_void_bitmap): New hook prototype. * targhoohs.h (hook_void_bitmap): Ditto. * bitmap.h (bitmap_head_def): Moved to coretypes.h. * coretypes.h (bitmap_head_def): Moved from bitmap.h. * target.h (live_on_entry): New function pointer. * df-scan.c (df_all_hard_regs): Removed. (df_scan_dump, df_hard_reg_init): Removed df_all_hard_regs. (df_scan_free_internal): Added df->entry_block_defs. (df_scan_alloc): Ditto. (df_scan_dump): Ditto. (df_uses_record): Plumbed flag field properly thru calls. Record EH_RETURN_DATA_REGNO in eh blocks unconditionally. This part fixes PR24762. (df_bb_refs_record): Added code to make the frame and arg pointers live in EH blocks. (df_refs_record): Added call to df_record_entry_block_defs. (df_record_entry_block_defs): New function. * df-core.c: Added comments to describe new artifical defs. * df.h (DF_REF_DIES_AFTER_THIS_USE): New flag in enum df_ref_flags. (entry_block_defs): New field in struct df. (df_all_hard_regs): Deleted. * target-def.h: Added TARGET_EXTRA_LIVE_ON_ENTRY. * df-problems.c (df_ru_bb_local_compute_process_def): Added code to handle artifical defs in the entry to a function. (df_ru_bb_local_compute): Ditto. (df_rd_bb_local_compute_process_def): Ditto. (df_rd_bb_local_compute): Ditto. (df_lr_bb_local_compute): Ditto. (df_ur_bb_local_compute): Ditto. (df_urec_bb_local_compute): Ditto. (df_chain_create_bb): Ditto. (df_ur_local_finalize): Removed entry. (df_urec_init): Ditto. (df_urec_local_finalize): Ditto. (df_ri_bb_compute): Added detection of last use of pseudos. * Makefile.in (df-scan.o): Updated dependencies. * config/mips/mips-protos.h (mips_set_live_on_entry): Added. * config/mips/mips.c (mips_set_live_on_entry): Added. * config/mips/mips.c (TARGET_EXTRA_LIVE_ON_ENTRY): Added value for target hook. * dce.c (marked_insn_p): Added code to handle artifical defs. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r110312
2006-01-27 23:23:32 +01:00
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS mips_init_builtins
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN mips_expand_builtin
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS HAVE_AS_TLS
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM mips_cannot_force_const_mem
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO mips_encode_section_info
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE mips_attribute_table
/* All our function attributes are related to how out-of-line copies should
be compiled or called. They don't in themselves prevent inlining. */
#undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P
#define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P hook_bool_const_tree_true
#undef TARGET_EXTRA_LIVE_ON_ENTRY
#define TARGET_EXTRA_LIVE_ON_ENTRY mips_extra_live_on_entry
#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P
#define TARGET_USE_BLOCKS_FOR_CONSTANT_P mips_use_blocks_for_constant_p
#undef TARGET_USE_ANCHORS_FOR_SYMBOL_P
#define TARGET_USE_ANCHORS_FOR_SYMBOL_P mips_use_anchors_for_symbol_p
#undef TARGET_COMP_TYPE_ATTRIBUTES
#define TARGET_COMP_TYPE_ATTRIBUTES mips_comp_type_attributes
#ifdef HAVE_AS_DTPRELWORD
#undef TARGET_ASM_OUTPUT_DWARF_DTPREL
#define TARGET_ASM_OUTPUT_DWARF_DTPREL mips_output_dwarf_dtprel
#endif
#undef TARGET_DWARF_REGISTER_SPAN
#define TARGET_DWARF_REGISTER_SPAN mips_dwarf_register_span
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-mips.h"